I need to change td’s text color based on odd/even, like this http://jsfiddle.net/N9gEG/
Actually I have a class which do this, but, I want to do from css
<table>
<tr>
<td>RED</td>
<td class="foo">BLUE</td>
<td>RED</td>
<td class="foo">BLUE</td>
</tr>
</table>
For tr odd/even I have the follow code: table tr:nth-child(even).
This works because of rule specificity. The more specific CSS rule wins.
tdwithout anything else is less specific thantd:nth-child(even), so it applies to the odd<td>s automatically.