当前位置: 首页 > news >正文

Element-UI的使用——表格el-table组件去除边框、滚动条设置、隔行变色、去除鼠标悬停变色效果(基于less)

// Element-ui table表格去掉所有边框,如下:
// 备注:若去掉所有边框,可自行将头部边框注释掉即可
// 该样式写在style scoped外面在el-table 中添加class="customer-table"类名
//去掉每行的下边框/deep/ .el-table td.el-table__cell,/deep/ .el-table th.el-table__cell.is-leaf {border-bottom: none;} // 去掉表格单元格边框
.customer-table th{border:none;}
.customer-table td,.customer-table th.is-leaf {border:none;
}
// 表格最外边框
.el-table--border, .el-table--group{border: none;
}
// 头部边框
.customer-table thead tr th.is-leaf{border: 1px solid #EBEEF5;border-right: none;
}
.customer-table thead tr th:nth-last-of-type(2){border-right: 1px solid #EBEEF5;
}
// 表格最外层边框-底部边框
.el-table--border::after, .el-table--group::after{width: 0;
}
.customer-table::before{width: 0;
}
.customer-table .el-table__fixed-right::before,.el-table__fixed::before{width: 0;
}
// 表格有滚动时表格头边框
.el-table--border th.gutter:last-of-type {border: 1px solid #EBEEF5;  border-left: none;
}
// 去除边框线
/deep/ .el-table::before {height: 0;
}

修改滚动条的样式,例如设置表格滚动条的颜色、宽度、 背景颜色等:

  /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {background-color: #2751be;border-radius: 6px;}/deep/ .el-table__body-wrapper::-webkit-scrollbar {width: 8px; // 横向滚动条height: 25px; // 纵向滚动条 必写background: #12244d;}/deep/ .el-table__body-wrapper::-webkit-scrollbar-track {border-radius: 10px; /*滚动条的背景区域的圆角*/background-color: rgb(18, 36, 77); /*滚动条的背景颜色*/}

隔行变色:

//el-table组件添加属性 :stripe="true"// 隔行变色(less)/deep/ .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {background-color: rgba(48, 112, 249, 0.05) !important;}

去除鼠标悬停变色效果

//去除鼠标触摸变色效果/deep/ .el-table  tbody tr:hover > td{background-color: transparent;}

http://www.lryc.cn/news/187117.html

相关文章:

  • python的一些知识点
  • QML 带框最大化显示方法
  • conda命令大全
  • 国庆要闻回顾 | OpenAI 拟研发 AI 手机;9月以太坊上NFT销售量创2021年2月以来最低记录...
  • 国家开放大学 模拟试题 训练
  • 【GIT版本控制】--常见问题与解决方案
  • Redis安装及key、string操作
  • TCP和UDP的由浅到深的详细讲解
  • 端粒/端粒酶生信切入点,6+端粒酶+泛癌+甲基化+实验。
  • XMLHttpRequest和Fetch API
  • U-boot下netconsole实现
  • Unity设计模式——原型模式
  • leetcode 96 不同的二叉搜索树
  • http发送和接收图片json文件
  • MM-Camera架构-ProcessCaptureRequest 流程分析
  • 196、管理 RabbitMQ 的用户
  • 【已解决】Python读取sql数据,报错:Not an executable object,解决方案
  • STM32 CubeMX ADC采集(HAL库)
  • [UUCTF 2022 新生赛]ezpop - 反序列化+字符串逃逸【***】
  • Selenium进行无界面爬虫开发
  • 万宾荣获深圳应博会“全球应急产业先锋奖”创始人发表峰会演讲
  • 某果的一个小参数分析
  • java学习--day22(进程线程)
  • 对音频切分成小音频(机器学习用)
  • TensorFlow案例学习:对服装图像进行分类
  • 单目3D目标检测——SMOKE 模型推理 | 可视化结果
  • C++智能指针shared_ptr使用详解
  • 基于Java的个性化旅游攻略系统设计与实现(源码+lw+ppt+部署文档+视频讲解等)
  • 中国替代方案探索:替代谷歌企业邮箱的选择
  • Holographic MIMO Surfaces (HMIMOS)以及Reconfigurable Holographic Surface(RHS)仿真