bordered.less 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. @import './size';
  2. @import (reference) '../../style/themes/index';
  3. @table-prefix-cls: ~'@{ant-prefix}-table';
  4. @table-border: @border-width-base @border-style-base @table-border-color;
  5. .@{table-prefix-cls}.@{table-prefix-cls}-bordered {
  6. // ============================ Title =============================
  7. > .@{table-prefix-cls}-title {
  8. border: @table-border;
  9. border-bottom: 0;
  10. }
  11. > .@{table-prefix-cls}-container {
  12. // ============================ Content ============================
  13. border-left: @table-border;
  14. > .@{table-prefix-cls}-content,
  15. > .@{table-prefix-cls}-header,
  16. > .@{table-prefix-cls}-body,
  17. > .@{table-prefix-cls}-summary {
  18. > table {
  19. // ============================= Cell =============================
  20. > thead > tr > th,
  21. > tbody > tr > td,
  22. > tfoot > tr > th,
  23. > tfoot > tr > td {
  24. border-right: @table-border;
  25. }
  26. // ============================ Header ============================
  27. > thead {
  28. > tr:not(:last-child) > th {
  29. border-bottom: @border-width-base @border-style-base @table-border-color;
  30. }
  31. > tr > th {
  32. &::before {
  33. background-color: transparent !important;
  34. }
  35. }
  36. }
  37. // Fixed right should provides additional border
  38. > thead > tr,
  39. > tbody > tr,
  40. > tfoot > tr {
  41. > .@{table-prefix-cls}-cell-fix-right-first::after {
  42. border-right: @table-border;
  43. }
  44. }
  45. }
  46. // ========================== Expandable ==========================
  47. > table > tbody > tr > td {
  48. > .@{table-prefix-cls}-expanded-row-fixed {
  49. margin: -@table-padding-vertical (-@table-padding-horizontal - @border-width-base);
  50. &::after {
  51. position: absolute;
  52. top: 0;
  53. right: @border-width-base;
  54. bottom: 0;
  55. border-right: @table-border;
  56. content: '';
  57. }
  58. }
  59. }
  60. }
  61. > .@{table-prefix-cls}-content,
  62. > .@{table-prefix-cls}-header {
  63. > table {
  64. border-top: @table-border;
  65. }
  66. }
  67. }
  68. &.@{table-prefix-cls}-scroll-horizontal {
  69. > .@{table-prefix-cls}-container > .@{table-prefix-cls}-body {
  70. > table > tbody {
  71. > tr.@{table-prefix-cls}-expanded-row,
  72. > tr.@{table-prefix-cls}-placeholder {
  73. > td {
  74. border-right: 0;
  75. }
  76. }
  77. }
  78. }
  79. }
  80. // Size related
  81. &.@{table-prefix-cls}-middle {
  82. > .@{table-prefix-cls}-container {
  83. > .@{table-prefix-cls}-content,
  84. > .@{table-prefix-cls}-body {
  85. > table > tbody > tr > td {
  86. > .@{table-prefix-cls}-expanded-row-fixed {
  87. margin: -@table-padding-vertical-md (-@table-padding-horizontal-md - @border-width-base);
  88. }
  89. }
  90. }
  91. }
  92. }
  93. &.@{table-prefix-cls}-small {
  94. > .@{table-prefix-cls}-container {
  95. > .@{table-prefix-cls}-content,
  96. > .@{table-prefix-cls}-body {
  97. > table > tbody > tr > td {
  98. > .@{table-prefix-cls}-expanded-row-fixed {
  99. margin: -@table-padding-vertical-sm (-@table-padding-horizontal-sm - @border-width-base);
  100. }
  101. }
  102. }
  103. }
  104. }
  105. // ============================ Footer ============================
  106. > .@{table-prefix-cls}-footer {
  107. border: @table-border;
  108. border-top: 0;
  109. }
  110. }
  111. .@{table-prefix-cls}-cell {
  112. // ============================ Nested ============================
  113. .@{table-prefix-cls}-container:first-child {
  114. // :first-child to avoid the case when bordered and title is set
  115. border-top: 0;
  116. }
  117. // https://github.com/ant-design/ant-design/issues/35577
  118. &-scrollbar:not([rowspan]) {
  119. box-shadow: 0 @border-width-base 0 @border-width-base @table-header-bg;
  120. }
  121. }