I have the following table: the first line contains 2 substrings, and the second contains 3 substrings.
In this css style, the color of the zebra ( i.e., the alternating color on two consecutive lines ) is faulty, the second main cell should be white, not gray:
tr:nth-child(odd) {background-color: #eee;} tr:nth-child(even) {background-color: #fff;}

So, is there a way to correctly change the color of such a table?
Of course, my real problem is with a much larger number of lines with a much more variable number of substrings.
<head> <style> tr:nth-child(odd) {background-color: #eee;} tr:nth-child(even) {background-color: #fff;} </style> <head> <body> <table border="1"> <tr> <td rowspan="2"> Big1 </td> <td> small1 </td> </tr> <tr> <td> small2 </td> </tr> <tr> <td rowspan="3"> Big2 </td> <td> small1 </td> </tr> <tr> <td> small2 </td> </tr> <tr> <td> small3 </td> </tr> </table> </body>
Vinzz
source share