From 1954cf999653dfb2b233b612ffeac15fde89668b Mon Sep 17 00:00:00 2001 From: Shivam Rawat Date: Tue, 1 Oct 2019 16:20:47 +0530 Subject: [PATCH] Fixes issue #10 Added css for responsive table --- lib/terminal.css | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/terminal.css b/lib/terminal.css index 3b06ae5..932fec5 100644 --- a/lib/terminal.css +++ b/lib/terminal.css @@ -986,3 +986,36 @@ figure > figcaption { .hljs-strong { font-weight: bold; } +/* RESPONSIVE TABLE */ +@media only screen + and (max-width: 400px), (min-device-width: 408px) + and (max-device-width: 1024px) { + table, thead, tbody, th, td, tr { + display: block; + } + thead tr { + position: absolute; + top: -9999px; + left: -9999px; + } + tr { + margin: 0 0 1rem 0; + } + tr:nth-child(odd) { + background: #ccc; + } + td { + border: none; + border-bottom: 1px solid #eee; + position: relative; + padding-left: 50%; + } + td:before { + position: absolute; + top: 0; + left: 6px; + width: 45%; + padding-right: 10px; + white-space: nowrap; + } +}