2

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?

1
  • 1
    have you tried putting the :visible before the :even? Commented Aug 27, 2010 at 17:36

1 Answer 1

11

Try adding the :visible pseudo-selector:

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

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

Sign up to request clarification or add additional context in comments.

1 Comment

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.