修改頭部樣式:
.el-table .el-table__header-wrapper tr th{ background-color: rgb(18, 47, 92)!important; color: rgb(255, 255, 255); }
修改每行樣式:
.el-table .el-table__row{ background-color: rgb(18, 47, 92); color: rgb(255, 255, 255); }
當然,使用 header-cell-style 和 row-style 也是可以的
鼠標hover每行的樣式:
.el-table .el-table__body tr.current-row > td { background-color: #0D1F34 !important; } .el-table .el-table__body tr:hover > td { background-color: #0D1F34 !important; }
修改表格每行邊框的樣式:
.el-table td, .el-table th.is-leaf{ border-bottom: 1px solid #4e73ac; border-right:1px solid #4e73ac; }
設置表格每行的高度:
.el-table__header tr, .el-table__header th{ height: 40px; padding: 0; } .el-table__body tr, .el-table__body td{ height: 40px; padding: 0; }
設置表格邊框顏色:
.el-table{ border: 1px solid #4e73ac; }
再添加:
.el-table--border::after, .el-table--group::after{ width: 0; } .el-table::before{ height: 0; }
如果 表格右邊框要比左邊框寬,下邊框要比上邊框高
最后修改一下el-table的樣式:
.el-table{ border-top: 1px solid #4e73ac; border-left: 1px solid #4e73ac; }