responsive-tables.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* Hide columns */
  2. @media only screen and (max-width: 1000px) {
  3. .hide-columns table td:nth-child(2),
  4. .hide-columns table th:nth-child(2) {
  5. display: none;
  6. }
  7. }
  8. @media only screen and (max-width: 810px) {
  9. .hide-columns table td:nth-child(4),
  10. .hide-columns table th:nth-child(4),
  11. .hide-columns table td:nth-child(7),
  12. .hide-columns table th:nth-child(7),
  13. .hide-columns table td:nth-child(8),
  14. .hide-columns table th:nth-child(8) {
  15. display: none;
  16. }
  17. }
  18. /* Scroll columns */
  19. @media only screen and (max-width: 1000px) {
  20. .scroll-columns .cf:after {
  21. visibility: hidden;
  22. display: block;
  23. font-size: 0;
  24. content: " ";
  25. clear: both;
  26. height: 0;
  27. }
  28. .scroll-columns * html .cf {
  29. zoom: 1;
  30. }
  31. .scroll-columns *:first-child+html .cf {
  32. zoom: 1;
  33. }
  34. .scroll-columns table {
  35. width: 100%;
  36. border-collapse: collapse;
  37. border-spacing: 0;
  38. }
  39. .scroll-columns th,
  40. .scroll-columns td {
  41. margin: 0;
  42. vertical-align: top;
  43. }
  44. .scroll-columns th {
  45. text-align: left;
  46. }
  47. .scroll-columns table {
  48. display: block;
  49. position: relative;
  50. width: 100%;
  51. }
  52. .scroll-columns thead {
  53. display: block;
  54. float: left;
  55. }
  56. .scroll-columns tbody {
  57. display: block;
  58. width: auto;
  59. position: relative;
  60. overflow-x: auto;
  61. white-space: nowrap;
  62. }
  63. .scroll-columns thead tr {
  64. display: block;
  65. }
  66. .scroll-columns th {
  67. display: block;
  68. text-align: right;
  69. }
  70. .scroll-columns tbody tr {
  71. display: inline-block;
  72. vertical-align: top;
  73. }
  74. .scroll-columns td {
  75. display: block;
  76. min-height: 1.25em;
  77. text-align: left;
  78. }
  79. .scroll-columns th {
  80. border-bottom: 0;
  81. border-left: 0;
  82. }
  83. .scroll-columns td {
  84. border-left: 0;
  85. border-right: 0;
  86. border-bottom: 0;
  87. }
  88. .scroll-columns tbody tr {
  89. border-left: 1px solid #dfe8f1;
  90. }
  91. .scroll-columns th:last-child,
  92. .scroll-columns td:last-child {
  93. border-bottom: 1px solid #dfe8f1;
  94. }
  95. }
  96. /* Remove columns */
  97. @media only screen and (max-width: 1000px) {
  98. .remove-columns table,
  99. .remove-columns thead,
  100. .remove-columns tbody,
  101. .remove-columns .table th,
  102. .remove-columns .table td,
  103. .remove-columns .table tr {
  104. display: block;
  105. }
  106. .remove-columns thead tr {
  107. position: absolute;
  108. top: -9999px;
  109. left: -9999px;
  110. }
  111. .remove-columns .table tr {
  112. border: 1px solid #dfe8f1;
  113. }
  114. .remove-columns .table td {
  115. border: none;
  116. border-bottom: 1px solid #eee;
  117. position: relative;
  118. padding-left: 50%;
  119. white-space: normal;
  120. text-align: left;
  121. }
  122. .remove-columns .table td:before {
  123. position: absolute;
  124. top: 6px;
  125. left: 6px;
  126. width: 45%;
  127. padding-right: 10px;
  128. white-space: nowrap;
  129. text-align: left;
  130. font-weight: bold;
  131. }
  132. .remove-columns .table td:before {
  133. content: attr(data-title);
  134. }
  135. }