views:

42

answers:

1

I have been using the following with no problems:

$("#tableid tr:even").addClass("evenClass");

But now I have rows in my table that are hidden which messes up the zebra striping styles. I have tried add 'is(":visible")' and things like that to no avail. Any ideas?

Thanks

+5  A: 

Try adding the :visible pseudo-selector:

$("#tableid tr:visible:even").addClass("evenClass");

Demo: http://jsfiddle.net/gRyFx/1/

karim79
Thanks very much. Didn't know you could chain pseudo-selectors
Nick Reeve