Nick Reeve
Nick Reeve

Reputation: 1680

jQuery Table Zebra Striping with hidden rows

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?

Upvotes: 2

Views: 2765

Answers (1)

karim79
karim79

Reputation: 342795

Try adding the :visible pseudo-selector:

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

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

Upvotes: 11

Related Questions