[jQuery] Odd/Even table row striping and hiding rows
Hi,
I am using the method below to stripe odd/even rows in a table. The
problem is, I need to hide some rows first, and only display them if
certain things are clicked. So what happens is if I hide some rows,
the odd/even gets messed up and I get two rows of the same color next
to each other.
Does anyone know how to deal with that?
<script type="text/javascript">
//add alternate row colors to tables with class basic (if any)
$(document).ready(function() {
$('#off_peak_yes').hide();
$('table.basic tr:even').addClass('even');
$('table.basic tr:odd').addClass('odd');
});
</script>
Thanks,
-Roman