Multiple Selectors
Multiple Selectors
I am having trouble with using multiple selectors for my table striping. I am currently using the following.
$("table:not(.no-stripe) tr:odd").addClass("tablestripe");
This works great except that occasionally there will be a row in the table that has a class assigned to it that ends with "tablehead" to give a different background and font color to the row. I don't want those rows to be affected by the striping.
<tr class="dkredtablehead">
I am also using
$("table:not(.no-stripe) tr:not([class*='tablehead'])").hover(
function() {
$(this).toggleClass("highlight");
},
function() {
$(this).toggleClass("highlight");
}
);
to achieve a hover highlight on the rows. As you can see, I have successfully excluded any row that has a class that ends with "tablehead". I just can't figure out how to combine the :not with the striping.
Thanks for your help!