el-table去除默认的背景色

本文介绍了如何修改Element-UI Table组件的样式,使之背景透明,文字颜色适配深色主题,重点展示了CSS选择器和样式的调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 这是我们在使用element-ui的Table 表格的默认样式

由于我的项目不需要白色,就改为了无色

::v-deep .el-form-item {
  margin: 0 5px !important;
  // padding: 20px;
  // background-color: ;
}
::v-deep .el-table,
.el-table__expanded-cell {
  padding: 20px !important;
  background-color: transparent !important;
}
::v-deep .el-table th {
  background-color: transparent !important;
  border-bottom: 1px solid #5078fc !important;
  color: #fefefe !important;
}
::v-deep .el-table tr {
  background-color: transparent !important;
}
::v-deep .el-table--enable-row-transition .el-table__body td,
::v-deep .el-table .cell {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
::v-deep .el-table th > .cell {
  color: rgba(254, 254, 254, 1) !important;
  font-weight: 700 !important;
}
.el-table::before {
  //去除底部白线
  left: 0 !important;
  bottom: 0 !important;
  width: 100%!important;
  height: 0px !important;
}

::v-deep .el-form-item__label {
  color: white !important;
}

由于的我背景色比较重,文字的颜色也改为了白色,可以根据项目修改 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mars空港

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值