前军教程网

中小站长与DIV+CSS网页布局开发技术人员的首选CSS学习平台

element UI table组件 修改单独行/列样式

博客:
https://blog.csdn.net/weixin_40297452/article/details/100126655

问题:因为我重写了一点样式,那个表头的第一列padding-left:0 (工程量紧靠着左边);

需求:工程量这列不能紧靠着左边,留点空隙,并给table thead 加边框

第一种方法:给table加一个类名,然后指定第一列和 表头的第一列

 .second-table td:first-of-type,.second-table th:first-of-type{
      padding-left: 15px;
    }

第二种方法:这种方法是加到行内样式,谨慎使用

//表格中加入:
:header-cell-style="secondheadCellStyle"

//在methods中写一个方法
 secondheadCellStyle({ row, column, rowIndex, columnIndex }) {  // 一级表头行的 style 的回调方法
      if (rowIndex == 0) {
          return {"border":"1px solid #e6edf0 !important"}
      }
  },




发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言