关于更改el-table样式
更改后的样式为
项目实现代码
因为要覆盖的是第三方element的样式,所以不能用scoped,如果当前文件不止表格的样式,可以建立一个css文件来进行引入,由于希望简单明了,本次该样式没有用到sass/less预处理器。
<style>
.mineral-table {
position: absolute;
right: 20px;
top: 100px;
width: 300px;
background-color: rgb(9, 8, 24);
}
/* 修改表头内容 */
.mineral-table .el-table__header-wrapper th {
background-color: rgb(9, 8, 24);
border-bottom: 1px solid #696969;
color: #fff;
}
/* 修改表格里内容 */
.mineral-table .el-table__body-wrapper tr td {
background-color: rgb(9, 8, 24);
border-bottom: 1px solid #696969;
color: #fff;
}
/* 选中的颜色 */
.mineral-table tbody tr.current-row > td {
background-color: #a0cfff;
}
/* 划过的颜色 */
.mineral-table tbody tr:hover > td {
background-color: #231994 !important;
}
</style>