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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Nick Reeve
  • 1,658
  • 2
  • 22
  • 32

1 Answers1

11

Try adding the :visible pseudo-selector:

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

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

karim79
  • 339,989
  • 67
  • 413
  • 406