Element-UI的使用——表格el-table组件去除边框、滚动条设置

// Element-ui table表格去掉所有边框,如下:
// 备注:若去掉所有边框,可自行将头部边框注释掉即可
// 该样式写在style scoped外面

在el-table 中添加class="customer-table"类名

// 去掉表格单元格边框
.customer-table th{
    border:none;
  }
.customer-table td,.customer-table th.is-leaf {
  border:none;
}
// 表格最外边框
.el-table--border, .el-table--group{
  border: none;
}
// 头部边框
.customer-table thead tr th.is-leaf{
  border: 1px solid #EBEEF5;
  border-right: none;
}
.customer-table thead tr th:nth-last-of-type(2){
  border-right: 1px solid #EBEEF5;
}
// 表格最外层边框-底部边框
.el-table--border::after, .el-table--group::after{
  width: 0;
}
.customer-table::before{
  width: 0;
}
.customer-table .el-table__fixed-right::before,.el-table__fixed::before{
  width: 0;
}
// 表格有滚动时表格头边框
.el-table--border th.gutter:last-of-type {
    border: 1px solid #EBEEF5;  
    border-left: none;
}
// 去除边框线
/deep/ .el-table::before {
    height: 0;
}

修改滚动条的样式,例如设置表格滚动条的颜色、宽度、 背景颜色等:

  /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
    background-color: #2751be;
    border-radius: 6px;
  }
  /deep/ .el-table__body-wrapper::-webkit-scrollbar {
    width: 8px; // 横向滚动条
    height: 25px; // 纵向滚动条 必写
    background: #12244d;
  }
  /deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
    border-radius: 10px; /*滚动条的背景区域的圆角*/
    background-color: rgb(18, 36, 77); /*滚动条的背景颜色*/
  }

猜你喜欢

转载自blog.csdn.net/m0_46318298/article/details/130820375