I want to loop through the first column of my table and set the cells to red if odd and blue if even.
In the follwoing: cell containg a, c would be red, and b would blue.
<table class='sortable'>
<tr>
<td>a</td>
<td>d</td>
<td>g</td>
</tr>
<tr>
<td>b</td>
<td>e</td>
<td>h</td>
</tr>
<tr>
<td>c</td>
<td>f</td>
<td>i</td>
</tr>
</table>
If you want to do it with a class and only the above listed table:
OR
If you want to have many rows (edit: and not know if the column with a,b,c will be first or second or not at all):
You’ll also need to specify your class