table.less 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // 自定义table
  2. @titleGray: #9ca5a8;
  3. @rowGray: #606769;
  4. @darkBack: #536268;
  5. .com-table {
  6. width: 100%;
  7. border-collapse: collapse;
  8. thead {
  9. tr {
  10. display: table;
  11. table-layout: fixed;
  12. width: 100%;
  13. th {
  14. background-color: fade(@darkBack, 20%);
  15. height: 30px;
  16. line-height: 30px;
  17. color: @titleGray;
  18. font-weight: 400;
  19. font-size: @fontsize-s;
  20. position: sticky;
  21. top: 0;
  22. cursor: pointer;
  23. &.light,
  24. &.always-light {
  25. color: @green;
  26. }
  27. }
  28. }
  29. }
  30. tbody {
  31. display: block;
  32. tr {
  33. display: table;
  34. table-layout: fixed;
  35. width: 100%;
  36. &:nth-child(2n) {
  37. background-color: fade(@rowGray, 20%);
  38. }
  39. td {
  40. padding: 4px;
  41. color: @rowGray;
  42. text-align: center;
  43. font-size: @fontsize-s;
  44. white-space: nowrap;
  45. overflow: hidden;
  46. text-overflow: ellipsis;
  47. & > span {
  48. white-space: nowrap;
  49. overflow: hidden;
  50. text-overflow: ellipsis;
  51. }
  52. &.light,
  53. &.always-light {
  54. color: @green !important;
  55. }
  56. &.num {
  57. font-family: "Bicubik";
  58. font-weight: 400;
  59. }
  60. }
  61. }
  62. }
  63. }