1.table tr:nth-child(odd){background: #ccc;}
结果如图所示可设置奇数行背景:
2.table tr:nth-child(even){background: #ccc;}
结果如图所示可设置偶数行背景:
1.table tr:nth-child(odd){background: #ccc;}
结果如图所示可设置奇数行背景:
2.table tr:nth-child(even){background: #ccc;}
结果如图所示可设置偶数行背景: