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

el-table 表格表头、单元格、滚动条样式修改

.2023.11.21今天我学习了如何对el-table表格样式进行修改,如图:

运用的两个样式主要是

1.header-cell-class-name(设置表头)

2.class-name(设置行单元格)

代码如下:

<el-table :data="typeList"class="real_operation_table":header-cell-class-name="'header_name_style'"><el-table-column :class-name="'all_cell_style'" align="center" v-for="(value, key) in typeList[0]" :key="key":prop="key"><template slot="header" slot-scope="scope"><span>{{ value.name }}</span></template><template slot-scope="scope"><span>{{ scope.row[key].value }}</span></template></el-table-column></el-table>

.el-table如果有class记得换成自己的类名 ,没有就直接用el-table

//添加表头表格颜色
::v-deep .header_name_style {background-color: rgb(4, 62, 114) !important;color: #4cd0ee;font-size: 20px;
}//添加单元格背景颜色
::v-deep .all_cell_style {background-color: rgb(5, 35, 61);color: #4cd0ee;font-size: 20px;
}//去掉表格底部边框
.real_operation_table::before {width: 0;
}//去掉单元格边框
::v-deep .real_operation_table .el-table__cell {border: none !important;
}::v-deep .el-table--scrollable-y .el-table__body-wrapper {background-color: rgb(5, 35, 61);
}::v-deep .real_operation_table .el-table__cell.gutter {background-color: rgb(6, 71, 128) !important;
}//鼠标移入效果
::v-deep.real_operation_table {// 每行鼠标经过得样式.el-table__body tr:hover > td {background-color: rgb(5, 35, 61) !important;}.el-table__body tr.current-row > td {background-color: rgb(5, 35, 61) !important;}
}// 滚动条样式
::v-deep ::-webkit-scrollbar {width: 0.4vh;
}::v-deep ::-webkit-scrollbar-track {background-color: transparent;
}::v-deep ::-webkit-scrollbar-thumb {background-color: rgb(68, 148, 220);border-radius: 4px;
}//去掉表格背景颜色
::v-deep .el-table {background-color: transparent !important;
}

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

相关文章:

  • dockerDesktop使用方法
  • [Ubuntu]RT810xE--网线已拔出--问题解决
  • 美国DDoS服务器:如何保护你的网站免遭攻击?
  • R语言数据缩放-1到1
  • C语言第二十五弹--打印菱形
  • PyTorch微调终极指南1:预训练模型调整
  • Uptime Kuma 企业微信群机器人告警
  • 【网络安全】-网络安全的分类详解
  • php利用ZipArchive类实现文件压缩与解压
  • Java面试附答案:掌握关键技能,突破面试难题!
  • API自动化测试:如何构建高效的测试流程
  • 字母异位词分组
  • SAP_ABAP_面试篇_关于Function Module函数的三种处理类型
  • CentOS简介、ISO类型、CentOS7安装与配置以及远程连接。
  • Audition 2024 24.0.0.46(音频剪辑)
  • Hive小文件处理
  • go语言学习之旅之Go语言函数
  • mysql的联合索引最左匹配原则问题
  • 三层交换机实现不同VLAN间通讯
  • C#枚举的使用
  • .Net6使用WebSocket与前端进行通信
  • hadoop 编写开启关闭集群脚本, hadoop hdfs,yarn开启关闭脚本。傻瓜式hadoop脚本 hadoop(九)
  • ArrayList中放的是一个对象,如何同时根据对象中的三个字段对List进行排序
  • MONGODB 的基础 NOSQL注入基础
  • 单链表实现【队列】
  • 随机微分方程的MATLAB数值求解
  • ChatGPT 也并非万能,品牌如何搭上 AIGC「快班车」
  • 【JavaSE】不允许你不会使用String类
  • 身份证阅读器和社保卡读卡器Harmony鸿蒙系统ArkTS语言SDK开发包
  • 并发与并行