Skip to content

Instantly share code, notes, and snippets.

@paceaux
Last active December 24, 2015 12:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paceaux/6796198 to your computer and use it in GitHub Desktop.
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
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;
}
@paceaux
Copy link
Author

paceaux commented Oct 2, 2013

in an effort to stay DRY... absolutely minimal markup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment