_table.scss 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. background-color: $white;
  12. border-bottom: 0;
  13. box-shadow: inset 0 1px 0 $table-border-color, inset 0 -1px 0 $table-border-color;
  14. position: sticky;
  15. top: 0;
  16. z-index: 10;
  17. }
  18. &.table-dark {
  19. thead tr {
  20. &:nth-child(1) th {
  21. background-color: $table-dark-bg;
  22. box-shadow: inset 0 1px 0 $table-dark-border-color, inset 0 -1px 0 $table-dark-border-color;
  23. }
  24. }
  25. }
  26. }
  27. // no border
  28. &.no-border {
  29. &,
  30. td,
  31. th {
  32. border: 0;
  33. }
  34. }
  35. // .text-center in tables
  36. &.text-center {
  37. &,
  38. td,
  39. th {
  40. text-align: center;
  41. }
  42. }
  43. &.table-valign-middle {
  44. thead > tr > th,
  45. thead > tr > td,
  46. tbody > tr > th,
  47. tbody > tr > td {
  48. vertical-align: middle;
  49. }
  50. }
  51. .card-body.p-0 & {
  52. thead > tr > th,
  53. thead > tr > td,
  54. tbody > tr > th,
  55. tbody > tr > td {
  56. &:first-of-type {
  57. padding-left: map-get($spacers, 4);
  58. }
  59. &:last-of-type {
  60. padding-right: map-get($spacers, 4);
  61. }
  62. }
  63. }
  64. }
  65. // Expandable Table
  66. .expandable-body {
  67. td {
  68. padding: 0;
  69. width: 100%;
  70. > div,
  71. > p {
  72. padding: $table-cell-padding;
  73. }
  74. }
  75. }