i want to dynamically add a class to all rows of a table except the first and last row. how would i do this without assigning a css class to the rows to identify them. I a
You can combine the .not() methods into one by separating the selectors with commas:
.not()
$('#id tr').not(':first, :last'); $('#id tr:not(:first, :last');
Note that the second one is not valid in pure CSS, only as a jQuery selector. For pure CSS you'd have to use @Sumit's answer.