table 隔行变色

1 /*从第二行(偶数行)开始变色*/
2 table tr:nth-child(2n){
3       background-color:red;
4 }
5 
6 /*从第一行(奇数行)开始变色*/
7 table tr:nth-child(2n-1){
8       background-color:red;
9 }
原文地址:https://www.cnblogs.com/1301694f/p/9044421.html