我有一张这样的桌子:
<table>
<tr>
<th>h1</th>
<th>h2</th>
<th>h3</th>
</tr>
<tr>
some content here
</tr>
<tr>
<td>1</td> <td>2</td> <td>3</td>
</tr>
<tr>
inside this row, I have a table which contains 2 rows
</tr>
<tr>
<td>1</td> <td>2</td> <td>3</td>
</tr>
<tr>
inside this row, I have a table which contains 2 rows
</tr>
<tr>
<td>1</td> <td>2</td> <td>3</td>
</tr>
<tr>
inside this row, I have a table which contains 2 rows
</tr>
//it repeats like this
</table>
我想从第 3 行开始使用 jquery 为每 3 行应用替代颜色,即,我希望以下代码部分具有替代颜色。我该怎么做?谢谢
<tr>
<td>1</td> <td>2</td> <td>3</td>
</tr>
<tr>
inside this row, I have a table which contains 2 rows
</tr>
基本上,我不想选择标题行和标题行之后的第一行。之后,我想每次选择 3 行,并给它另一种颜色。3 行将是如上所示的行。