Skip to content

Instantly share code, notes, and snippets.

@Quinten
Created February 10, 2016 10:35
Show Gist options
  • Save Quinten/5be081ad84978bb4c7c8 to your computer and use it in GitHub Desktop.
Save Quinten/5be081ad84978bb4c7c8 to your computer and use it in GitHub Desktop.
A table that switches to a vertical layout on mobile
@include breakpoint(max-width, $bp-medium) {
table.rwd-table {
display: block;
thead {
display: none;
tr, th {
display: none;
}
}
tbody {
display: block;
tr {
display: block;
border-bottom: $default-border;
&:last-child {
border-bottom: 0;
}
td {
display: block;
border-bottom: 0;
&[data-rwd-label] {
div {
display: inline-block;
}
&:before {
content: attr(data-rwd-label) ":";
display: inline-block;
padding-right: .5em;
font-weight: bold;
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment