Skip to content

Instantly share code, notes, and snippets.

@AndrejsAbrickis
Last active November 22, 2016 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrejsAbrickis/6f9c566f2e0cd4d0954a4bd1f63b59fd to your computer and use it in GitHub Desktop.
Save AndrejsAbrickis/6f9c566f2e0cd4d0954a4bd1f63b59fd to your computer and use it in GitHub Desktop.
/* Some CSS reset */
* {
box-sizing: border-box;
}
/* Base styles to make it look a bit more like table */
.headings,
.row {
border: 1px solid #ddd;
}
.row {
margin-top: 8px;
padding: 8px;
}
/* Table styles on default aka Small screen */
.headings {
display: none;
}
.cell {
text-align: right;
}
.cell:before {
content: attr(data-label);
float: left;
}
/* Table styles on Medium and Large screen */
@media (min-width: 768px) {
.container {
overflow-x: scroll;
overflow-y: hidden;
}
.headings {
display: block;
}
.headings:before,
.headings:after,
.row:before,
.row:after {
content: " ";
display: table;
}
.row-container {
padding-left: 160px;
overflow: hidden;
width: 1170px;
}
.cell {
float: left;
padding: 0 8px;
text-align: left;
width: 9.0909090909%;
}
.cell:before {
display: none;
}
.cell.fixed {
background-color: white;
display: block;
margin-left: -160px;
position: absolute;
text-align: left;
}
.cell.wider {
width: 160px;
}
.row {
border-top: none;
margin-top: 0;
padding: 4px 0;
width: 1170px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment