Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jimbobmcgee/edd734e4bfc3eb7c90ae7ef001f8b756 to your computer and use it in GitHub Desktop.
Save jimbobmcgee/edd734e4bfc3eb7c90ae7ef001f8b756 to your computer and use it in GitHub Desktop.
Spectre.css fixed first-column for scrollable tables
.table tbody th {
font-weight: 600;
border-bottom: 0.05rem solid rgb(218, 222, 228);
}
.table.table-scroll {
position: relative;
}
.table.table-scroll th:nth-child(1) {
position: sticky;
left: 0;
background: #fff padding-box repeat scroll 0% 0%;
z-index: 20;
}
.table.table-scroll.table-striped tbody tr:nth-of-type(2n+1) th:nth-child(1) {
background: rgb(247, 248, 249) padding-box repeat scroll 0% 0%;
}
.table.table-scroll.table-hover tbody tr:hover th:nth-child(1) {
background: rgb(238, 240, 243) padding-box repeat scroll 0% 0%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment