当前位置:   article > 正文

修改el-table滚动条&设置el-table行高&表格样式_el-table设置滚动条

el-table设置滚动条
1、滚动条
右侧滚动条设置
  1. :deep(.el-table--enable-row-transition .el-table__body td.el-table__cell):hover {
  2. color: #e62d28;
  3. background-color: #f0f0f0;
  4. }
  5. ::v-deep .el-table--small th, .el-table--small td {
  6. padding:0px 0px 0px 0px;
  7. height:40px;
  8. }
 下方滚动条设置
  1. // 滚动条样式
  2. // 胶囊背景色
  3. ::v-deep .el-table__body-wrapper::-webkit-srollbar-track {
  4. background-color: rgba(255, 255, 255, 0);
  5. }
  6. //可设置胶囊宽高
  7. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  8. height: 12px;
  9. width: 10px;
  10. opacity: 0.5;
  11. }
  12. // 设置胶囊色
  13. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  14. border-radius: 15px;
  15. background-color: #cdd9e6;
  16. }
全局
  1. //滚动条的宽度
  2. ::-webkit-scrollbar {
  3. width: 8px;
  4. height: 8px;
  5. background-color: #ffffff00;
  6. border-radius: 6px;
  7. }
  8. //滚动条的滑块
  9. ::-webkit-scrollbar-thumb {
  10. background-color: #cdd9e6;
  11. border-radius: 6px;
  12. }
  13. ::-webkit-srollbar-track {
  14. background-color: rgba(255, 255, 255, 0);
  15. }
  16. ::-webkit-scrollbar {
  17. height: 12px;
  18. width: 10px;
  19. opacity: 0.5;
  20. }
  21. ::-webkit-scrollbar-thumb {
  22. border-radius: 15px;
  23. background-color: #cdd9e6;
  24. }
2、设置el-table行高
  1. ::v-deep .el-table--small th, .el-table--small td {
  2. padding:0px 0px 0px 0px;
  3. height:30px;
  4. }
3、el-table  css改变样式

  1. <template>
  2. <div class="dept-management approve-table">
  3. <el-table :data="list" style="width: 100%" header-cell-class-name="approve-thead" class="approval-table">
  4. <el-table-column prop="name" label="姓名" align="center" header-align="center"> </el-table-column>
  5. <el-table-column prop="sex" label="性别" align="center" header-align="center"> </el-table-column>
  6. </el-table>
  7. </div>
  8. </template>
  1. <style>
  2. .approve-table {
  3. .approval-table {
  4. border: 1px solid #e5e5e5;
  5. &::before {
  6. height: 0;
  7. }
  8. &.el-table td {
  9. border: 0;
  10. }
  11. .approve-thead {
  12. border-bottom: 1px solid #e5e5e5;
  13. height: 45px;
  14. line-height: 43px;
  15. background: #f5f5f5;
  16. overflow: hidden;
  17. font-size: 13px;
  18. padding: 0;
  19. color: #333;
  20. }
  21. .el-table__body {
  22. border-collapse: collapse;
  23. tr+tr {
  24. border-top: 1px dashed #e5e5e5;
  25. }
  26. }
  27. }
  28. .approval-table .el-button {
  29. padding: 0
  30. }
  31. .approve-table-edit {
  32. color: #337ab7;
  33. &:hover {
  34. text-decoration: underline;
  35. }
  36. }
  37. }
  38. .approve-table-form {
  39. margin-top: 20px;
  40. padding-right: 30px;
  41. }
  42. </style>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/850918
推荐阅读
相关标签
  

闽ICP备14008679号