table.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. .m-table {
  2. width: 100%;
  3. max-width: 100%;
  4. height: 100%;
  5. overflow: hidden;
  6. box-sizing: border-box;
  7. flex: 1;
  8. background-color: #fff;
  9. font-size: 14px;
  10. color: #606266;
  11. position: relative;
  12. .table-scroll{
  13. height: 100%;
  14. overflow-y: auto;
  15. &::-webkit-scrollbar {
  16. display: block;
  17. width: 5px;
  18. height: 1px;
  19. }
  20. &::-webkit-scrollbar-thumb {
  21. border-radius: 8px;
  22. background: #ccc;
  23. }
  24. &::-webkit-scrollbar-track {
  25. border-radius: 8px;
  26. background: #fff;
  27. }
  28. }
  29. .fixed-header{
  30. position: absolute;
  31. top: 0;
  32. left: 0;
  33. }
  34. .m-table__header{
  35. table-layout: fixed;
  36. border-collapse: separate;
  37. .m-table__cell{
  38. min-width: 0;
  39. padding: 12px 0;
  40. box-sizing: border-box;
  41. text-overflow: ellipsis;
  42. vertical-align: middle;
  43. position: relative;
  44. text-align: left;
  45. border-bottom: 1px solid #ebeef5;
  46. .cell{
  47. overflow: hidden;
  48. text-overflow: ellipsis;
  49. white-space: normal;
  50. word-break: break-all;
  51. line-height: 23px;
  52. padding-left: 10px;
  53. padding-right: 10px;
  54. box-sizing: border-box;
  55. }
  56. }
  57. }
  58. .m-table__body{
  59. table-layout: fixed;
  60. border-collapse: separate;
  61. overflow-y: scroll;
  62. .m-table__row{
  63. .m-table__cell{
  64. min-width: 0;
  65. padding: 12px 0;
  66. box-sizing: border-box;
  67. text-overflow: ellipsis;
  68. vertical-align: middle;
  69. position: relative;
  70. text-align: left;
  71. border-bottom: 1px solid #ebeef5;
  72. .cell{
  73. overflow: hidden;
  74. text-overflow: ellipsis;
  75. white-space: normal;
  76. word-break: break-all;
  77. line-height: 23px;
  78. padding-left: 10px;
  79. padding-right: 10px;
  80. box-sizing: border-box;
  81. }
  82. }
  83. }
  84. .m-table-row-highlight{
  85. .m-table__cell{
  86. background-color: #ecf5ff;
  87. }
  88. }
  89. }
  90. .m-table-stripe{
  91. .m-table__body{
  92. tr:nth-child(2n) {
  93. td{
  94. background-color: #f8f8f9;
  95. }
  96. }
  97. }
  98. }
  99. .m-table-border{
  100. border: 1px solid #ebeef5;
  101. .m-table__cell{
  102. border-right: 1px solid #ebeef5;
  103. }
  104. }
  105. }