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
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!
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
3 matches
Mail list logo