Zebra table - altering color

Zebra table - altering color

Hi,

I have a table with many rows. With this script I'm adding a extra class
to each odd <tr>:

var tSelect = $("#mainContent table tr:odd");
      tSelect.each(function(index) {
         $(this).addClass("stripe_dark");
      });


Now I extended the <tr> with a hidden one for each row to hide details

<tr/>
<tr class="hidden">
<tr/>
<tr class="hidden">
...

Unfortunately now all visible rows have the same color as the other one
are hidden but in DOM. Is there a way to say "add class to every third element=?

thx
TC