MediaWiki: Tweeki.css
From Serenes Forest - A Fire Emblem Resource
Line 18: | Line 18: | ||
th { | th { | ||
padding: 0.25em; | padding: 0.25em; | ||
+ | } | ||
+ | |||
+ | tr:nth-child(n+2) th { | ||
+ | position: -webkit-sticky; /* for Safari */ | ||
+ | position: sticky; | ||
+ | left: 0; | ||
+ | background: #FFF; | ||
+ | border-right: 1px solid #CCC; | ||
} | } | ||
Line 28: | Line 36: | ||
} | } | ||
− | tr:nth-child(n+2) | + | tr:nth-child(n+2) th:first-child { |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
left: 0; | left: 0; | ||
z-index: -1; | z-index: -1; | ||
} | } |
Revision as of 13:22, 27 October 2020
.table { width: auto; height: auto; max-width: 100vw; max-height: 100vh; overflow: auto; position: relative; display: inline-block; } .table table { position: relative; border-collapse: collapse; margin: 0; } td, th { padding: 0.25em; } tr:nth-child(n+2) th { position: -webkit-sticky; /* for Safari */ position: sticky; left: 0; background: #FFF; border-right: 1px solid #CCC; } tr:first-child th { position: -webkit-sticky; /* for Safari */ position: sticky; top: 0; background: #000; color: #FFF; } tr:nth-child(n+2) th:first-child { left: 0; z-index: -1; }