_table.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //
  2. // Component: Table
  3. //
  4. .table {
  5. &:not(.table-dark) {
  6. color: inherit;
  7. }
  8. // fixed table head
  9. &.table-head-fixed {
  10. thead tr:nth-child(1) th {
  11. position: sticky;
  12. top: 0;
  13. z-index: 10;
  14. background-color: $white;
  15. border-bottom: 0;
  16. box-shadow: inset 0 1px 0 $table-border-color, inset 0 -1px 0 $table-border-color;
  17. }
  18. // TODO: add $table-dark
  19. // &.table-dark {
  20. // thead tr {
  21. // &:nth-child(1) th {
  22. // background-color: $table-dark-bg;
  23. // box-shadow: inset 0 1px 0 $table-dark-border-color, inset 0 -1px 0 $table-dark-border-color;
  24. // }
  25. // }
  26. // }
  27. }
  28. // no border
  29. &.no-border {
  30. &,
  31. td,
  32. th {
  33. border: 0;
  34. }
  35. }
  36. // .text-center in tables
  37. &.text-center {
  38. &,
  39. td,
  40. th {
  41. text-align: center;
  42. }
  43. }
  44. &.table-valign-middle {
  45. thead > tr > th,
  46. thead > tr > td,
  47. tbody > tr > th,
  48. tbody > tr > td {
  49. vertical-align: middle;
  50. }
  51. }
  52. .card-body.p-0 & {
  53. thead > tr > th,
  54. thead > tr > td,
  55. tfoot > tr > th,
  56. tfoot > tr > td,
  57. tbody > tr > th,
  58. tbody > tr > td {
  59. &:first-of-type {
  60. padding-left: map-get($spacers, 4);
  61. }
  62. &:last-of-type {
  63. padding-right: map-get($spacers, 4);
  64. }
  65. }
  66. }
  67. }
  68. // Expandable Table
  69. .table-hover tbody tr.expandable-body:hover {
  70. background-color: inherit !important;
  71. }
  72. [data-widget="expandable-table"] {
  73. cursor: pointer;
  74. i.expandable-table-caret {
  75. @include transition(transform $lte-transition-speed linear);
  76. }
  77. &[aria-expanded="true"] {
  78. td i.expandable-table-caret {
  79. // stylelint-disable selector-max-attribute
  80. &[class*="right"] {
  81. transform: rotate(90deg);
  82. }
  83. &[class*="left"] {
  84. transform: rotate(-90deg);
  85. }
  86. // stylelint-enable selector-max-attribute
  87. }
  88. }
  89. }
  90. .expandable-body {
  91. > td {
  92. width: 100%;
  93. padding: 0 !important;
  94. > div,
  95. > p {
  96. padding: $table-cell-padding-y $table-cell-padding-x;
  97. }
  98. }
  99. .table {
  100. width: subtract(100%, $table-cell-padding-x);
  101. margin: 0 0 0 $table-cell-padding-x;
  102. tr:first-child {
  103. td,
  104. th {
  105. border-top: none;
  106. }
  107. }
  108. }
  109. }