From b7d634cbfa6c9800d5b191386548de3224d924c9 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 2 Nov 2020 22:27:22 +0300 Subject: [PATCH] Make the header of the table sticky (#7) --- static/main.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/main.css b/static/main.css index c29203b..a861f40 100644 --- a/static/main.css +++ b/static/main.css @@ -65,6 +65,20 @@ td:first-child { text-align: right; } +/* Sticky header for the table. */ +th { + background: #333333; + box-shadow: 0px 2px 2px 0px rgb(0, 0, 0, 25%); + padding: 4px 2px; + position: -webkit-sticky; + position: sticky; + z-index: 1; /* Show on top of table cells. */ + top: 0; /* Stick to the top of the screen. */ +} +th:first-child { + border-left: 1px solid #333333; /* Fixes left border during scroll; must have a valid color, transparent doesn't work. */ +} + .completion-complete { color: var(--completion-complete-color); }