Conditional alternative table row styles in HTML5
- by Budda
Is there any changes regarding this questions Conditional alternative table row styles since HTML5 came in?
Here is a copy of original question:
Is it possible to style alternate table rows without defining classes on alternate tags?
With the following table, can CSS define alternate row styles WITHOUT having to give the alternate rows the class "row1/row2"? row1 can be default, so row2 is the issue.
<style>
.altTable td { }
.altTable .row2 td { background-color: #EEE; }
</style>
<table class="altTable">
<thead><tr><td></td></tr></thead>
<tbody>
<tr><td></td></tr>
<tr class="row2"><td></td></tr>
<tr><td></td></tr>
<tr class="row2"><td></td></tr>
</tbody>
</table>
Thanks a lot!