Hey,

The following code will let you build your row, then insert it after
the first (assumed to be header) row.


// Build your row here:
var row = "<tr><td>blah</td></tr>";

$("#yourTable tr:first").after(row);

You might want to change your table to be of the format:

<table>
   <thead>
     <tr> ... </tr>
   </thead>
   <tbody>
      .....
    </tbody>
</table>

This format is required for the table sorter plugin, if you ever want
to use that, and allows for easier selection of head vs body content
for future coding.  If you did change to that format, you would change
the above code to:

$("#yourTable thead").append(row);

to add another header row, or

$("#yourTable tbody").prepend(row);

to add a new body row to the top.

- Jamie Goodfellow




On Feb 15, 5:48 pm, Shelane <[EMAIL PROTECTED]> wrote:
> I would like to add a row to a table.  The first row is a header.  So
> I want to add it just under the header row.  How would I accomplish
> such an endeavor?

Reply via email to