el-table的樣式修改


修改頭部樣式:

.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;
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM