[jQuery] Re: Zebra table with hidden rows

2007-07-05 Thread Karl Swedberg
This should work, too* : $("table.xy tr:visible:odd").addClass("odd") * Might not work after first table if more than one class="xy"> exists on the same page. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 5, 2007, at 1:03 PM, Scott Sauyet

[jQuery] Re: Zebra table with hidden rows

2007-07-05 Thread Thomas Jaggi
This is not tested, but something like this might do it: $("table.xy tr:visible").each(function(index) { if (index %2 == 1) { $(this).addClass("odd"); } }); It's perfect, thank you!

[jQuery] Re: Zebra table with hidden rows

2007-07-05 Thread Scott Sauyet
backflip wrote: I'm using the following code to style a table: $("table.xy tr:nth-child(odd)").addClass("odd"); But before doing that I'm hiding some rows: $("tr#xy").hide(); Now the zebra pattern isn't working any more (it's an abnormal zebra), of course. How to apply the zebra-stuff ju