Skip to content Skip to sidebar Skip to footer

Select Rows In A Table Except The Table Header Rows

How to select rows in a html table except the table header rows using jquery?

Solution 1:

$('tr').not('thead tr').addClass('selected')

Solution 2:

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');

Solution 3:

You can exclude thead using not

$('#mytable tr').not('thead tr')

Solution 4:

This selector selects all tr elements in #mytable except the first one (the header).

$('#mytable tr:not(:first)')

Post a Comment for "Select Rows In A Table Except The Table Header Rows"