I\'m trying to style a table so that each row is a different colour (odd/even). I have the following CSS:
#woo tr:nth-child(even) td {
background-color: #f0f
If you are using jQuery, you can employ one of its functions, for example .filter(), to choose only the elements that are visible. But the key here is a CSS selector :visible
.
For example (see jsfiddle):
jQuery('tr:visible:odd').css({'background-color': 'red'});
jQuery('tr:visible:even').css({'background-color': 'yellow'});