当前位置:   article > 正文

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

element表格横线去除

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

  1. <div class="custom-table">
  2. <el-table>
  3. </el-table>
  4. </div>

css: 

  1. // 設置label的背景色
  2. .custom-table ::v-deep .el-table th {
  3. background: var(--cool-gray-50, #F9FAFB);
  4. border-bottom: none;
  5. }
  6. // 取消行之间的横向边框线
  7. .custom-table ::v-deep .el-table td, .el-table th.is-leaf {
  8. border-bottom: none;
  9. }
  10. //去掉最下面的那一条线
  11. .custom-table ::v-deep .el-table::before {
  12. height: 0px;
  13. }

原始效果 

修改后效果

题外话:

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

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

以及有时候的背景色问题

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

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

 

 

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/530529
推荐阅读
相关标签
  

闽ICP备14008679号