How to select rows in a html table except the table header rows using jquery?
<table id="mytable"> <thead> <tr> <th> Foo </th> <td> Lorem </td> <td> Ipsum </td> </tr> </thead> <tr> <th> Bar </th> <td> Dolor </td> <td> Sit </td> </tr> <tr> <th> Baz </th> <td> Amet </td> <td> Consectetuer </td> </tr> </table>
A table header row is the top row of a table that acts as a title for the type of information they will find in each column.
To change the table header row, select the new row you would like to set as the table header, right-click on the row header, and select "Set row as table header" from the dropdown.
A table header is a row at the top of a table used to label each column. For example, in the below table there are three columns with a "Name," "Date of Birth," and "Phone" header. Example of a table header in HTML. Header row in a Microsoft Excel table. Header row in Microsoft Word.
<tr>: The Table Row element. The <tr> HTML element defines a row of cells in a table. The row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements.
$('tr').not('thead tr').addClass('selected')
You should wrap the rows in a <tbody>
element (some browsers will do this anyway!), then select the children of that tbody:
$('#mytable > tbody > tr');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With