码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • el-table 表格表头、单元格、滚动条样式修改


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

    运用的两个样式主要是

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

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

    代码如下:

    1. <el-table :data="typeList"
    2. class="real_operation_table"
    3. :header-cell-class-name="'header_name_style'">
    4. <el-table-column :class-name="'all_cell_style'" align="center" v-for="(value, key) in typeList[0]" :key="key"
    5. :prop="key">
    6. <template slot="header" slot-scope="scope">
    7. <span>{{ value.name }}span>
    8. template>
    9. <template slot-scope="scope">
    10. <span>{{ scope.row[key].value }}span>
    11. template>
    12. el-table-column>
    13. el-table>

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

    1. //添加表头表格颜色
    2. ::v-deep .header_name_style {
    3. background-color: rgb(4, 62, 114) !important;
    4. color: #4cd0ee;
    5. font-size: 20px;
    6. }
    7. //添加单元格背景颜色
    8. ::v-deep .all_cell_style {
    9. background-color: rgb(5, 35, 61);
    10. color: #4cd0ee;
    11. font-size: 20px;
    12. }
    13. //去掉表格底部边框
    14. .real_operation_table::before {
    15. width: 0;
    16. }
    17. //去掉单元格边框
    18. ::v-deep .real_operation_table .el-table__cell {
    19. border: none !important;
    20. }
    21. ::v-deep .el-table--scrollable-y .el-table__body-wrapper {
    22. background-color: rgb(5, 35, 61);
    23. }
    24. ::v-deep .real_operation_table .el-table__cell.gutter {
    25. background-color: rgb(6, 71, 128) !important;
    26. }
    27. //鼠标移入效果
    28. ::v-deep.real_operation_table {
    29. // 每行鼠标经过得样式
    30. .el-table__body tr:hover > td {
    31. background-color: rgb(5, 35, 61) !important;
    32. }
    33. .el-table__body tr.current-row > td {
    34. background-color: rgb(5, 35, 61) !important;
    35. }
    36. }
    37. // 滚动条样式
    38. ::v-deep ::-webkit-scrollbar {
    39. width: 0.4vh;
    40. }
    41. ::v-deep ::-webkit-scrollbar-track {
    42. background-color: transparent;
    43. }
    44. ::v-deep ::-webkit-scrollbar-thumb {
    45. background-color: rgb(68, 148, 220);
    46. border-radius: 4px;
    47. }
    48. //去掉表格背景颜色
    49. ::v-deep .el-table {
    50. background-color: transparent !important;
    51. }

  • 相关阅读:
    地址标准化服务AI深度学习模型推理优化实践
    必应bing广告推广和谷歌google广告的区别
    uni-app 小宠物 - 会说话的小鸟
    用ChatGPT,快速设计一个真实的账号系统
    【Godot】【BUG】4.x NavigationAgent 导航不生效
    20240417,友元 FRIEND
    【软件与系统安全笔记】四、内存破坏漏洞
    大数据下一代变革之必研究数据湖技术Hudi原理实战双管齐下-后续
    离线数仓搭建_03_Hadoop的配置与优化测试
    【每日一题Day327】LCP 50. 宝石补给 | 模拟
  • 原文地址:https://blog.csdn.net/qq_53986004/article/details/134523608
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号