<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-stickyTableHeaders.css</id>
	<title>MediaWiki:Gadget-stickyTableHeaders.css - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-stickyTableHeaders.css"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=MediaWiki:Gadget-stickyTableHeaders.css&amp;action=history"/>
	<updated>2026-05-28T06:08:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=MediaWiki:Gadget-stickyTableHeaders.css&amp;diff=894&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;/* keeps table headers stuck to the top of the window,    useful for long tables where it normally scrolls offscreen        KNOWN PROBLEMS    - borders disappear due to browser implementation issue (https://bugs.webkit.org/show_bug.cgi?id=128486)    - double-row headers only work as long as the first &lt;tr&gt; does not stretch its height, since MediaWiki doesn&#039;t support &lt;thead&gt;    - Safari makes the th elements in &lt;tfoot&gt; scroll down along with the top, if they are made stick...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=MediaWiki:Gadget-stickyTableHeaders.css&amp;diff=894&amp;oldid=prev"/>
		<updated>2024-10-13T00:51:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;/* keeps table headers stuck to the top of the window,    useful for long tables where it normally scrolls offscreen        KNOWN PROBLEMS    - borders disappear due to browser implementation issue (https://bugs.webkit.org/show_bug.cgi?id=128486)    - double-row headers only work as long as the first &amp;lt;tr&amp;gt; does not stretch its height, since MediaWiki doesn&amp;#039;t support &amp;lt;thead&amp;gt;    - Safari makes the th elements in &amp;lt;tfoot&amp;gt; scroll down along with the top, if they are made stick...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/* keeps table headers stuck to the top of the window,&lt;br /&gt;
   useful for long tables where it normally scrolls offscreen&lt;br /&gt;
   &lt;br /&gt;
   KNOWN PROBLEMS&lt;br /&gt;
   - borders disappear due to browser implementation issue (https://bugs.webkit.org/show_bug.cgi?id=128486)&lt;br /&gt;
   - double-row headers only work as long as the first &amp;lt;tr&amp;gt; does not stretch its height, since MediaWiki doesn&amp;#039;t support &amp;lt;thead&amp;gt;&lt;br /&gt;
   - Safari makes the th elements in &amp;lt;tfoot&amp;gt; scroll down along with the top, if they are made sticky. table &amp;gt; :not(tfoot) fixes this.&lt;br /&gt;
   - Our code editor on the wiki apparently seems to think :not() selectors are not allowed to have complex selectors, so it throws an error.&lt;br /&gt;
     This is incorrect (see https://developer.mozilla.org/en-US/docs/Web/CSS/:not and https://jigsaw.w3.org/css-validator/validator), so this error&lt;br /&gt;
     can safely be ignored.&lt;br /&gt;
&lt;br /&gt;
   USAGE&lt;br /&gt;
   - sticky headers are opt-in using the &amp;quot;sticky-header&amp;quot; class (eg. {| class=&amp;quot;wikitable sticky-header&amp;quot;)&lt;br /&gt;
   - IF using multiple rows of &amp;lt;th&amp;gt;, the first row must not exceed 2.3em in height.&lt;br /&gt;
     - If it does, set a custom style=&amp;quot;top: 2.4em;&amp;quot; (or something similar) on the second row of &amp;lt;th&amp;gt;&lt;br /&gt;
   - To sticky intermediate headers, mark their table-row as |-class=&amp;quot;sticky-header&amp;quot; as well.&lt;br /&gt;
     - Note: This won&amp;#039;t look good when the top header is 2 rows high, but the intermediate rows are 1 row high.&lt;br /&gt;
   - don&amp;#039;t add sticky headers to tables shorter than roughly 1000px - use your best judgement&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
table.sticky-header &amp;gt; :not(tfoot):not(thead + tbody) tr:first-child th, /* Ignore the error here. :not(thead + tbody) is fully valid CSS.*/&lt;br /&gt;
table.sticky-header &amp;gt; :not(tfoot):not(thead + tbody) tr:nth-child(2) th,&lt;br /&gt;
tr.sticky-header th {&lt;br /&gt;
	position: -webkit-sticky;&lt;br /&gt;
	position: sticky;&lt;br /&gt;
	height: 2.3em; /* taller contents will override */&lt;br /&gt;
	box-sizing: border-box;&lt;br /&gt;
	top: -1px; /* chrome has a see-through border? */&lt;br /&gt;
	border-bottom: 0;&lt;br /&gt;
	z-index: 1; /* kart maps overlap with the &amp;lt;th&amp;gt;s: [[Fairy_rings]] */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Move the second row of sticky headers down exactly the height of a single-line th */&lt;br /&gt;
table.sticky-header &amp;gt; :not(tfoot) tr:nth-child(2) th {&lt;br /&gt;
	top: calc(2.3em - 1px);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* fake a bottom border - see known problems */&lt;br /&gt;
table.sticky-header &amp;gt; :not(tfoot) tr:first-child th::after,&lt;br /&gt;
table.sticky-header &amp;gt; :not(tfoot) tr:nth-child(2) th::after,&lt;br /&gt;
tr.sticky-header th::after {&lt;br /&gt;
	content: &amp;#039;&amp;#039;;&lt;br /&gt;
	position: absolute;&lt;br /&gt;
	left: 0;&lt;br /&gt;
	bottom: -1px; /* merge into existing border */&lt;br /&gt;
	width: 100%;&lt;br /&gt;
	border-bottom: 1px solid var(--wikitable-border);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* move down when sticky page header is enabled */&lt;br /&gt;
.wgl-stickyheader.action-view table.sticky-header tr:first-child th,&lt;br /&gt;
.wgl-stickyheader.action-view table.sticky-header tr:nth-child(2) th,&lt;br /&gt;
.wgl-stickyheader.action-view tr.sticky-header th {&lt;br /&gt;
	top: 2.5rem; /* height of sticky header in rem because of template/skin font adjustments */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Move the second row of sticky headers down exactly the height of a single-line th */&lt;br /&gt;
.wgl-stickyheader.action-view table.sticky-header tr:nth-child(2) th {&lt;br /&gt;
	top: calc(2.5rem + 2.3em - 1px); /* 2.5rem on top of calc({height} + {top}) w.r.t. previous &amp;lt;th&amp;gt; styles. */&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>