_termine.scss 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @media
  2. only screen
  3. and (min-device-width: 500px) {
  4. .termine-table {
  5. width: 66.666%;
  6. th {
  7. @include geologica-font(normal,600);
  8. width: 50%;
  9. &:nth-of-type(1){
  10. text-align: right;
  11. padding-right: 2em;
  12. }
  13. &:nth-of-type(2){
  14. text-align: left;
  15. padding-left: 2em;
  16. }
  17. }
  18. tbody {
  19. tr {
  20. &:nth-child(odd) {
  21. background: #ccc;
  22. }
  23. td:nth-of-type(1) {
  24. text-align: right;
  25. padding-right: 2em;
  26. }
  27. td:nth-of-type(2){
  28. text-align: left;
  29. padding-left: 2em;
  30. }
  31. }
  32. }
  33. }
  34. }
  35. @media
  36. only screen
  37. and (max-width: 420px), (min-device-width: 428px)
  38. and (max-device-width: 500px) {
  39. /* Force table to not be like tables anymore */
  40. table, thead, tbody, th, td, tr {
  41. display: block;
  42. }
  43. /* Hide table headers (but not display: none;, for accessibility) */
  44. thead tr {
  45. position: absolute;
  46. top: -9999px;
  47. left: -9999px;
  48. }
  49. tr {
  50. margin: 0 0 1rem 0;
  51. }
  52. tr:nth-child(odd) {
  53. background: #ccc;
  54. }
  55. td {
  56. /* Behave like a "row" */
  57. border: none;
  58. border-bottom: 1px solid #eee;
  59. position: relative;
  60. padding-left: 50%;
  61. }
  62. td:before {
  63. /* Now like a table header */
  64. position: absolute;
  65. /* Top/left values mimic padding */
  66. top: 0;
  67. left: 6px;
  68. width: 45%;
  69. padding-right: 10px;
  70. white-space: nowrap;
  71. }
  72. /*
  73. Label the data
  74. You could also use a data-* attribute and content for this. That way "bloats" the HTML, this way means you need to keep HTML and CSS in sync. Lea Verou has a clever way to handle with text-shadow.
  75. */
  76. td:nth-of-type(1):before { content: "Datum: "; }
  77. td:nth-of-type(2):before { content: "Beschreibung: "; }
  78. }