Pure CSS odd-even style
No JS scripts
...ignore
Is it possible with CSS3?
Write class
or
in interval tr. Note on typing td th (does not meet the standard)
<!DOCTYPE HTML><html> <head> <meta charset="gb2312" /> <title></title> <style> td { background:#eee; } th { font-weight:normal; background:#ddd; } </style> </head> <body> <table> <tr> <td>1-1</td> <td>1-1</td> <td>1-1</td> </tr> <tr> <th>1-1</th> <th>1-1</th> <th>1-1</th> </tr> <tr> <td>1-1</td> <td>1-1</td> <td>1-1</td> </tr> </table> </body></html>
https://developer.mozilla.org/en /CSS/:nth-child
IE9
http://www.cnblogs.com/xihulangzi/articles/939591.html
Define 2 class styles
Odd lines Use different ones for even-numbered rows.
This complicates the problem again. . . .
Turns out it can’t be done. I’ll just use js script to do it. Thank you everyone