Last active
April 15, 2020 15:59
-
-
Save tflight/513b8864cc0057c922067b089239ecb4 to your computer and use it in GitHub Desktop.
Boostrap 4 Stackable Tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.table-stack { | |
display: block; | |
} | |
.table-stack tr { | |
display: block; | |
} | |
.table-stack thead { | |
display: none; | |
} | |
.table-stack tbody { | |
display:block; | |
} | |
.table-stack td{ | |
display: block; | |
border: none; | |
&:before { | |
content: attr(data-title); | |
display:block; | |
text-transform: uppercase; | |
@extend small; | |
@extend .text-muted; | |
} | |
} | |
@each $breakpoint in map-keys($grid-breakpoints) { | |
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); | |
@include media-breakpoint-up($breakpoint) { | |
.table-stack.table-horizontal#{$infix} { | |
display: table; | |
} | |
.table-stack.table-horizontal#{$infix} thead { | |
display: table-header-group; | |
} | |
.table-stack.table-horizontal#{$infix} tbody { | |
display: table-row-group; | |
} | |
.table-stack.table-horizontal#{$infix} th { | |
display: table-cell; | |
} | |
.table-stack.table-horizontal#{$infix} tr { | |
display: table-row; | |
} | |
.table-stack.table-horizontal#{$infix} td{ | |
display: table-cell; | |
&:before { | |
display:none; | |
} | |
} | |
} | |
} |
Author
tflight
commented
Apr 15, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment