直接上代码

table tr:nth-child(odd){background:#efefef;}/*奇数行*/
table tr:nth-child(even){background:#efefef;}/*#偶数行*/
table td:nth-child(odd){color:red;}/*#奇数列*/
table td:nth-child(even){color:black;}/*#偶数列*/
table tr:nth-child(10){background:#efefef;color:red;}/*#第10行*/
table td:nth-child(10){background:#efefef;color:black;}/*#第10列*/
table tr:nth-child(3n+0){background:#efefef;color:red;}/*公式 (an + b)。描述:a表示周期的长度,n 是计数器(从 0 开始),b 是偏移值; 这里指定了下标是 3 的倍数的行的背景色*/
table td:nth-child(3n+0){background:#efefef;color:red;}/*公式 (an + b)。描述:a表示周期的长度,n 是计数器(从 0 开始),b 是偏移值; 这里指定了下标是 3 的倍数的列的背景色*/

部分内容抄自:思想永无止境