Can Jquery zebra stripe a table where some rows are being set to 'display:none' and still have the visable rows alternate in color, without two rows having the same color next to each other?
+7
A:
This is possible with the :visible and the :odd (or the :even) selectors:
$('table').find('tr:visible:odd').addClass('odd');
Then you can do:
table tr td {
background-color: #fff;
}
table tr.odd td {
background-color: #c1c1c1;
}
Paolo Bergantino
2009-08-29 23:17:44
How about $('tr:visible:odd').addClass('odd')?
adardesign
2009-08-30 20:56:13