MediaWiki: Tweeki.css
From Serenes Forest - A Fire Emblem Resource
(Created page with "div .table { width: auto; height: auto; max-width: 100vw; max-height: 100vh; overflow: auto; position: relative; display: inline-block; } table { position: re...") |
|||
Line 1: | Line 1: | ||
− | + | .table { | |
width: auto; | width: auto; | ||
height: auto; | height: auto; | ||
Line 9: | Line 9: | ||
} | } | ||
− | table { | + | .table table { |
position: relative; | position: relative; | ||
border-collapse: collapse; | border-collapse: collapse; | ||
Line 20: | Line 20: | ||
} | } | ||
− | + | tr:first-child th { | |
position: -webkit-sticky; /* for Safari */ | position: -webkit-sticky; /* for Safari */ | ||
position: sticky; | position: sticky; | ||
Line 28: | Line 28: | ||
} | } | ||
− | + | tr:nth-child(n+2) th { | |
position: -webkit-sticky; /* for Safari */ | position: -webkit-sticky; /* for Safari */ | ||
position: sticky; | position: sticky; | ||
Line 36: | Line 36: | ||
} | } | ||
− | + | tr th:first-child { | |
left: 0; | left: 0; | ||
z-index: 1; | z-index: 1; | ||
} | } |
Revision as of 12:58, 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:first-child th { position: -webkit-sticky; /* for Safari */ position: sticky; top: 0; background: #000; color: #FFF; } tr:nth-child(n+2) th { position: -webkit-sticky; /* for Safari */ position: sticky; left: 0; background: #FFF; border-right: 1px solid #CCC; } tr th:first-child { left: 0; z-index: 1; }