隔行变色(奇数行变色、偶数行变色、n行分组,每组n行变色)

 /* :nth-of-type(odd)奇数行  */
  /* .el-table th:nth-of-type(odd),
  .el-table tr:nth-of-type(odd) {
    background: #d1ffec;
  } */

  /* :nth-of-type(even)偶数行  */
  /* .el-table th:nth-of-type(even),
  .el-table tr:nth-of-type(even) {
    background: #ffcc00;
  } */

  /* :nth-child(4n+1)从第一行开始算起 每隔4个(包含第四个)使用此样式  */
  /* .el-table th:nth-child(4n+1),
  .el-table tr:nth-child(4n+1) {
    background: #00ccff;
  } */

  /* :nth-child(4n+2)从第二行开始算起 每隔4个(包含第四个)使用次样式  */
  /* .el-table th:nth-child(4n+2),
  .el-table tr:nth-child(4n+2) {
    background: #090;
  } */

  /* :nth-child(4n+3)从第三行开始算起 每隔4个(包含第四个)使用次样式  */
  /* .el-table th:nth-child(4n+3),
  .el-table tr:nth-child(4n+3) {
    background: #009;
  } */

  /* :nth-child(4n+4)从第四行开始算起 每隔4个(包含第四个)使用次样式  */
  /* .el-table th:nth-child(4n+4),
  .el-table tr:nth-child(4n+4) {
    background: #990;
  } */

 

posted @ 2021-02-24 15:10  Deer_Lin  阅读(515)  评论(0)    收藏  举报