设置 table 行颜色交替 利用 css 的奇/偶数选择器 tr:nth-child(odd){ background-color: rgb(227,248,231); } tr:nth-child(even){ background-color: rgb(236,246,238); }