<html> <head> <script type="text/javascript"> window.addEventListener('load', function() { document.getElementsByTagName('tr')[1].insertBefore(document.createElement('link'), document.getElementsByTagName('tr')[1].firstChild); }, false); </script> </head> <body> <table> <tr><td>foo</td></tr> <tr><td>foo</td></tr> </table> </body> </html>