vue+elementui table表格无背景效果

14 篇文章 0 订阅

效果

在这里插入图片描述


template部分

			<el-table
            :header-cell-style="{
              backgroundColor: 'transparent',
              color: '#ffffff',
              fontSize: fontSize(12),
              textAlign: 'center'
            }"
            :cell-style="{
              color: '#fff',
              backgroundColor: 'transparent',
              fontSize: fontSize(8),
              textAlign: 'center'
            }"
            :row-style="{
              color: '#fff',
              backgroundColor: 'transparent',
              fontSize: fontSize(8),
              textAlign: 'center'
            }"
            :data="projectTableData"
            style="width: 100%"
          >
            <el-table-column prop="cat" label="分类"> </el-table-column>
            <el-table-column label="2022">
              <el-table-column prop="num2022" label="数量" width="60">
              </el-table-column>
              <el-table-column prop="jine2022" label="金额" width="60">
              </el-table-column>
            </el-table-column>
          </el-table> 

css部分


      // .t_btn2为你的上级父元素class名称
      // 由于是只在本页面修改, 所以必须要用 /deep/ 或者 >>> 才能生效  /deep/ 是深度选择器,可自行百度了解更多
      .t_btn2 /deep/ .el-table,
      .el-table__expanded-cell {
        background-color: transparent;
      }
      .t_btn2 /deep/ .el-table tr {
        background-color: transparent !important;
      }
      .t_btn2 /deep/ .el-table--enable-row-transition .el-table__body td,
      .el-table .cell {
        padding: 0;
        background-color: transparent;
      }
      // .t_btn2 /deep/ .el-table__row > td {
      //   border: none;
      // }
      /* 清除底部横线 */
      .el-table::before {
        height: 0px;
      }
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值