Using only CSS, is it possible to somehow style a table differently depending on the number of rows (or columns)
Scenario, I have a table defined like this:
<table class='my-table-css'>
<tr> <td></td></tr>
........
<tr> <td></td></tr>
</table>
If there are more than three rows in the table I need to color even rows differently than odd rows
If there are less than four rows in the table I need to color even rows and odd rows the same way
Table 1, even rows have background color
--------------
Row 1 | | |
--------------
Row 2 | BG | BG |
--------------
Row 3 | | |
--------------
Row 4 | BG | BG |
--------------
Table 2, even rows have no background color
--------------
Row 1 | | |
--------------
Row 2 | | |
--------------
Row 3 | | |
I need to accomplish this using CSS only, any ideas from CSS gurus out there?