Problem with jQuery's :nth-child and hidden rows
<p>I have a simple table with a zebra-effect:</p>

<pre><code>$('table.zebra tbody tr:nth-child(odd)').addClass('darker');</code></pre>

<p>Now I have to hide/show certain rows though. But when I do this, those hidden rows will still count and the zebra-effect doesn't really work anymore. Say rows 1 is shown, 2 is hidden, and 3 is shown again. Now both 1 and 3 are displayed on top of each other since 2 is hidden, but they both have the darker background from the <code>darker</code> class since they're both odd.</p>

<p>I tried something like this:</p>

<pre><code>$('table.zebra tbody tr:nth-child(odd):not(.hide)').addClass('darker');</code></pre>

<p>But it seems like it doesn't skip the rows with the class <code>hide</code> when counting, causing the same problem.</p>

<p>Is there a trick to only count the rows that are not hidden and determine whether <em>they</em> are odd or even? Preferably using the jQuery selectors instead of some function.</p>
