Search code examples
jqueryhtmlhtml-tableprepend

How to prepend a tr to after first tr at a table?


Possible Duplicate:
Inserting new table row after the first table row using JQuery

I have populated a tr for my table and I want to prepend it after the firts tr. I use this:

$('#myTable').prepend($tr);

As usual, it adds my new tt to the top.

How can I add it as second?


Solution

  • You will want to use jquery after, like this:

    $('#myTable tr:first').after($tr);