el-table去除默认的背景色

 这是我们在使用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;
}

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

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: 你可以使用以下 CSS 样式来去掉 el-table 的鼠标背景色: ```css .el-table__row:hover { background-color: transparent; } ``` 这会将鼠标悬停在 el-table 行上时的背景色设置为透明,从而达到去除背景色的效果。 ### 回答2: 要去掉 el-table 组件的鼠标背景色,可以通过修改样式来实现。首先,给 el-table 组件的父级元素添加一个类名,例如 "table-container"。然后,在样式表中添加以下样式: ```css .table-container .el-table tr:hover { background-color: transparent !important; } ``` 这样,当鼠标悬停在 el-table 的行上时,背景色将会变为透明,从而去掉了鼠标背景色。 需要注意的是,这里使用了 "tr:hover" 选择器来选中悬停的行,如果 el-table 组件的行元素不是 tr 标签,需要根据实际情况调整选择器中的行元素。另外,使用 "!important" 标记可以确保样式优先级,从而确保背景色被覆盖。 希望以上方法能够解决您的问题。使用 el-table 时,很多样式都可以通过修改样式表来进行自定义,希望您在使用中能够灵活运用。 ### 回答3: 在使用element-ui的el-table组件时,如果想去掉鼠标在表格行上移动时的背景色,可以通过自定义样式来实现。 首先,在使用el-table组件的地方添加一个自定义的类名,例如"my-table"。 然后,在样式表中添加如下样式: ```css .my-table .el-table__row:hover { background-color: transparent !important; } ``` 上述代码中,".my-table"是表格所在的包裹元素的类名,".el-table__row:hover"选择器表示鼠标在表格行上移动时的样式,"background-color: transparent !important;"表示将背景色设置为透明,同时通过!important关键字来提高优先级。 最后,给el-table组件的外层容器元素添加"my-table"类名即可。 这样,鼠标在el-table组件的行上移动时将不再显示背景色
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Mars空港

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

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

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

打赏作者

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

抵扣说明:

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

余额充值