el-table设置表头背景色tr间距和tr背景色

1、设置表头背景色,在el-table标签上添加header-cell-style

:header-cell-style="{background:'#000'}"

2、设置除表格内容的每行行高,在el-table标签上添加row-style

:row-style="{height:80+'px'}"

3、设置表头文字样式

::v-deep .el-table__header-wrapper {
  thead {
    th{
      div{
        font-weight: 700;
        font-size: 20px;
      }
    }
  }
}

4、表格内容区域隔行换色

//表格内容颜色
::v-deep .el-table__body tbody tr:nth-child(odd) {
  background-color: #282828;
}
::v-deep .el-table__body tbody tr:nth-child(even) td {
  background-color: #393939;
}

5、表格tr间距

::v-deep .el-table__body {
    border-collapse: separate !important;
    border-spacing: 0 15px !important;
    table-layout: auto !important;
  }
::v-deep .el-table,.el-table__expanded-cell {
    background-color: transparent !important;
}
::v-deep .el-table--enable-row-transition .el-table__body td,.el-table .cell {
  background-color: transparent;
}

图片样式

在这里插入图片描述

 .el-table::before{
    background-color: transparent;
  }
  ::v-deep .el-table__header tr,
  ::v-deep .el-table th, .el-table tr{
    background-color:transparent;
  }

 ::v-deep .el-table th>.cell{
    font-weight: 700;
    color: #fab969;
    font-size: 30px;
  }
  ::v-deep .el-table tbody tr td:nth-child(-n+2) div{
    color: #d1bc8d;
  }
   ::v-deep .el-table tbody tr td div{
    font-size: 32px;
   }
  
  ::v-deep .el-table__body {
    border-collapse: separate !important;
    border-spacing: 0 15px !important;
    table-layout: auto !important;
    tbody tr:nth-child(odd) {
      background-color: #282827;
    }
    tbody tr:nth-child(even) td {
      background-color: #3e3e3e;
    }
  }
  ::v-deep .el-table,.el-table__expanded-cell {
      background-color: transparent !important;
  }
  ::v-deep .el-table--enable-row-transition .el-table__body td,.el-table .cell {
    background-color: transparent;
  }
小Bug

在这里插入图片描述用下面样式修改即可

 ::v-deep .el-table__header tr,
  ::v-deep .el-table th, .el-table tr{
    background-color:transparent;
  }
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值