关键词搜索

源码搜索 ×
×

Web前端笔记-修改element ui中表格样式(透明、去横纵线等含修改思路)

发布2020-06-08浏览3086次

详情内容

官方效果是这样的:

此处改成了这样的效果:

此处是可以进行滑动的,就是去除了滑动条,仍能滑动的效果。

下面说下修改样式,找到使用el-table的vue组建:

在style中贴上:

  1. <style>
  2. table-wrapper /deep/ .el-table--fit{
  3. padding: 20px !important;
  4. border: none !important;
  5. }
  6. .table-wrapper .el-table, .el-table__expanded-cell {
  7. background-color: transparent !important;
  8. border: none !important;
  9. }
  10. .table-wrapper /deep/ .el-table tr {
  11. background-color: transparent !important;
  12. border: none;
  13. }
  14. .el-table /deep/ .el-table--enable-row-transition .el-table__body td, .el-table .cell{
  15. background-color: transparent !important;
  16. border: none;
  17. }
  18. /*表中数据的颜色及背景等*/
  19. .el-table th, .el-table tr {
  20. border: 0!important;
  21. background-color: transparent!important;
  22. color: white !important;
  23. }
  24. /*去每一行记录下的横线*/
  25. .el-table--border tr,td{
  26. border: none!important;
  27. }
  28. /*去最下面的横线*/
  29. .el-table::before{
  30. height:0;
  31. }
  32. /*table内的高亮*/
  33. .el-table tbody tr:hover>td {
  34. background-color:rgb(79, 163, 213)!important
  35. }
  36. </style>

这里在style上不能加scope。

然后在组建外面套一个div在其class上使用table-wrapper

此处修改样式的逻辑是直接F12,打开开发者工具:

那个css影响了就改哪一个。

修改了的css要使用!important;避免被覆盖。通过这种方式去改element ui中的默认样式。

 

 

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载