**
项目要实现如下效果,如何改变el-table的样式呢?具体操作如下:
**
1.给el-table加上新的class类。
2.不要在原有的带有scoped的style里添加样式。新写一个style。加上如下代码即可。
<style>
/* 去掉表格单元格边框 */
.my-table th{
border:none;
}
.my-table td,.my-table th.is-leaf {
border:none;
}
/* 表格最外边框 */
.el-table--border, .el-table--group{
border: none;
}
/* 头部边框 */
.my-table thead tr th.is-leaf{
border-bottom: 1px solid #EBEEF5;
border-right: none;
}
.my-table thead tr th:nth-last-of-type(2){
}
/* 表格最外层边框-底部边框 */
.el-table--border::after, .el-table--group::after{
width: 0;
}
.my-table::before{
width: 0;
}
.my-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;
}
</style>