From 6582e9b18755edbedd349d29df95971bfe0e99b5 Mon Sep 17 00:00:00 2001 From: Steven Kalt Date: Sun, 24 May 2020 16:31:28 -0400 Subject: [PATCH 1/2] feat(tables): use sticky headers --- css/main.scss | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/css/main.scss b/css/main.scss index fbdf86e10..44f25ad86 100644 --- a/css/main.scss +++ b/css/main.scss @@ -44,6 +44,23 @@ h2 { margin-bottom: 20px; } +table.table-responsive.table-bordered { + display: table; + & thead > tr { + border: none; + & > th { + position: sticky; + position: -webkit-sticky; + position: -moz-sticky; + position: -ms-sticky; + position: -o-sticky; + top: 55px; + background: #fff; + outline: 1px solid #e9ecef; + } + } +} + .toc { font-size: 85% } From 953f3ad9e350faba0c87e84dbf93e396b95e71a5 Mon Sep 17 00:00:00 2001 From: Steven Kalt Date: Sun, 24 May 2020 16:49:34 -0400 Subject: [PATCH 2/2] fix: use rem's for sticky table header offset to match sticky page header height --- css/main.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css/main.scss b/css/main.scss index 44f25ad86..e62a0bca9 100644 --- a/css/main.scss +++ b/css/main.scss @@ -54,7 +54,8 @@ table.table-responsive.table-bordered { position: -moz-sticky; position: -ms-sticky; position: -o-sticky; - top: 55px; + top: 3rem; // 2.5rem for the header's height + padding, + // +.5rem for the tr's own padding background: #fff; outline: 1px solid #e9ecef; }