el-table 合计放顶部 以及放下面滚动条以上 以及各项样式修改

el-table 合计带来了很多便利 但是其一些样式或者位置比较难修改  下面是一些方法

放顶部

  .el-table .el-table__body-wrapper {

    order: 1 !important;

  }

修改这个层级

修改每一样样式需要用到CSS选择器

  .el-table .has-gutter tr {

    td {

      padding: 0;

    }

    td:nth-of-type(1) {

      color: rgb(51, 51, 51);

    }

    td:nth-of-type(2) {

      color: #458ff3;

    }

    td:nth-of-type(3) {

      color: #458ff3;

    }

    td:nth-of-type(4) {

      color: #333333;

    }

    td:nth-of-type(5) {

      color: #ff6761;

    }

    td:nth-of-type(6) {

      color: #ff8b17;

    }

    td:nth-of-type(7) {

      color: #ff8b17;

    }

    td:nth-of-type(8) {

      color: #333333;

    }

 

放底部

  .el-table--scrollable-x .el-table__body-wrapper {

    overflow-x: hidden !important;

    z-index: 2 !important;

  }

  .el-table__footer-wrapper {

    overflow-x: auto;

    border-top: 1px solid #f4f4f4;

  }

需要去找到底部DOM 监听 然后让合计行跟着一起滚动

const footDom = this.$refs.eltable.$refs.footerWrapper

    footDom.addEventListener('scroll', () => {

      const left = footDom.scrollLeft

      this.$refs.eltable.$refs.bodyWrapper.scrollLeft = left

    })

 

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值