Element UI 组件 Table 去除单元格底部的横线并设置label背景色

有时候直接修改组件样式是不生效的,我们需要穿透,先在外部加一个div

<div class="custom-table">
    <el-table>
    </el-table>
</div>

css: 

// 設置label的背景色
.custom-table ::v-deep .el-table th {
  background: var(--cool-gray-50, #F9FAFB);
  border-bottom: none; 
}

// 取消行之间的横向边框线
.custom-table ::v-deep .el-table td, .el-table th.is-leaf {
  border-bottom: none; 
}

//去掉最下面的那一条线
.custom-table ::v-deep .el-table::before {
  height: 0px;
}

原始效果 

修改后效果

题外话:

 睁眼图标:Eye fill · Bootstrap 图标库 (bootcss.com)

 闭眼图标:Eye slash fill · Bootstrap 图标库 (bootcss.com)

以及有时候的背景色问题

在对应组件设置一个透明的颜色就行

<el-tag style="background-color: #0000;border-color: #0000;">
        <svg></svg>
</el-tag>

 

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值