Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pure-CSS fixed table headers
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
You can’t perform that action at this time.