JQuery: select rows in Threes
<p>I have a table like this:</p>

<pre><code>&lt;table&gt;
   &lt;tr&gt;
      &lt;th&gt;h1&lt;/th&gt;
      &lt;th&gt;h2&lt;/th&gt;
      &lt;th&gt;h3&lt;/th&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
      some content here
  &lt;/tr&gt;

  &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      inside this row, I have a table which contains 2 rows
  &lt;/tr&gt;


   &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      inside this row, I have a table which contains 2 rows
  &lt;/tr&gt;

   &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      inside this row, I have a table which contains 2 rows
  &lt;/tr&gt;
  //it repeats like this


&lt;/table&gt;
</code></pre>

<p>I'd like to apply alternative color for every 3 rows using jquery starting at the 3rd row, ie, I'd like the following section of code has alternative color. How to I do that? Thanks</p>

<pre><code>      &lt;tr&gt;
         &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          inside this row, I have a table which contains 2 rows
      &lt;/tr&gt;
</code></pre>

<p>Basically, I don't want select header row and the first row after header row. after that, I want to select 3 rows each time, and give it an alternative color. The 3 rows will be the rows shown as above.</p>
