Last active
December 24, 2015 12:09
-
-
Save paceaux/6796198 to your computer and use it in GitHub Desktop.
all the core properties stylus to make an HTML table display with the CSS flex box module
This file contains hidden or 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 { | |
display: flex; | |
flex-direction: column; | |
align-items: stretch; | |
} | |
thead { | |
order: -1; | |
} | |
tbody { | |
flex-grow: 1; | |
} | |
tfoot { | |
order: 1; | |
} | |
thead, | |
tbody, | |
tfoot { | |
display: inherit; | |
flex-direction: inherit; | |
justify-content: space-between; | |
align-items: stretch; | |
} | |
tr { | |
display: inherit; | |
flex-direction: row; | |
justify-content: space-between; | |
align-items: stretch; | |
flex-grow: 1; | |
} | |
td, | |
th { | |
flex-basis: 15%; | |
flex-grow: 2; | |
text-align: left; | |
} | |
.table--reverse { | |
flex-direction: row; | |
min-height: 8em; | |
} | |
.table--reverse tr { | |
flex-direction: column; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in an effort to stay DRY... absolutely minimal markup.