Responsive table

  |   by kadriad   |   Blogi, css  |  No Comments

Responsive disainiga lehel oli postituses tabel – tabel ise ei skaleerunud nii nagu vaja.

Skaleeruva tabeli näide on siin:

https://css-tricks.com/examples/ResponsiveTables/responsive.php

Siin on css-osa:

table {
  width: 100%;
}

@media screen and (max-width: 880px){
 table, table, thead, tbody, th, td, tr {
  display: block;
}
 table td {
  width: 100%;
  float: none;
  margin: 1.5% auto;
}
td:before {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 45%;
  padding-right: 10px;
  white-space: nowrap;
}

}