Last active
April 21, 2016 01:34
-
-
Save johncip/1a831a302ad99044727fac88aff67717 to your computer and use it in GitHub Desktop.
Pure-CSS fixed table headers
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.fixed-header | |
table-layout: fixed | |
border-collapse: collapse | |
thead tr | |
display: block | |
position: relative | |
tbody | |
display: block | |
overflow: auto | |
width: 100% | |
height: $table-body-height | |
// (need to specify table & column widths) | |
td, th | |
&:nth-child(1) | |
min-width: $col-1-width | |
&:nth-child(2) | |
min-width: $col-2-width | |
// ... | |
&:last-child | |
width: 100% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment