- 修改的表格样式有:斑马线、滚动条、滚动区域、字体颜色、底部白线、表格暂无数据背景

<template>
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 0px)"
//设置表格头部样式
:header-cell-style="{
color: '#fff',
background: '#074252',
fontWeight: 'normal',
height: '44px',
}"
:row-class-name="tableRowClassName"
>
</template>
// 设置表格斑马线
methods:{
// 设置表格斑马线
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 0) {
return "table-item-1";
} else {
return "table-item-2";
}
},
}
::v-deep .el-table__row.table-item-1 {
background: #11697b;
}
::v-deep .el-table__row.table-item-2 {
background: #094152;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
width: 0;
}
::v-deep .el-table th.el-table__cell.is-leaf,
.el-table td.el-table__cell {
border: none;
}
/ 滚动区域 -----
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #2cebfe;
-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
}
::-webkit-scrollbar-thumb:window-inactive {
background: #2cebfe;
}
::v-deep .el-table th.gutter {
display: none;
width: 0;
}
::v-deep.el-table th.el-table__cell.is-leaf,
::v-deep.el-table td.el-table__cell {
border: none;
}
::v-deep .cell {
color: white;
}
::v-deep .el-table__body tr.hover-row > td.el-table__cell,
.el-table__body tr.hover-row.current-row > td.el-table__cell,
.el-table__body tr.hover-row.el-table__row--striped > td.el-table__cell,
.el-table__body
tr.hover-row.el-table__row--striped.current-row
> td.el-table__cell {
background: transparent;
}
::v-deep .el-table::before,
.el-table--group::after,
.el-table--border::after {
background-color: transparent;
}
::v-deep .el-table__fixed::before,
.el-table__fixed-right::before {
background-color: transparent;
}
::v-deep .el-table {
background-color: transparent;
}