From e66421a5779474bb74a1db75f75a18d5c8c27ab3 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 12 Dec 2020 02:56:12 -0700 Subject: [PATCH] use top-oriented approach to add margin to table; remove top margin on table when first child in AsciiDoc table cell --- src/css/doc.css | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/css/doc.css b/src/css/doc.css index d974fa7..9cbdef4 100644 --- a/src/css/doc.css +++ b/src/css/doc.css @@ -193,26 +193,30 @@ .doc table.tableblock { font-size: calc(15 / var(--rem-base) * 1rem); - margin: 2rem 0; - /* enable table-layout: fixed if you want the table width to be enforced strictly */ - /* alternative is to wrap table in div and set overflow-x: auto on the wrapper */ - /* table-layout: fixed; */ + margin: 1.5rem 0 0; +} + +.doc table.tableblock + * { + margin-top: 1.5rem; +} + +.doc td.tableblock > .content > :first-child { + margin-top: 0; +} + +.doc table.tableblock th, +.doc table.tableblock td { + padding: 0.5rem; } .doc table.tableblock thead th { border-bottom: 2.5px solid var(--table-border-color); - padding: 0.5rem; } .doc table.tableblock td, .doc table.tableblock > :not(thead) th { border-top: 1px solid var(--table-border-color); border-bottom: 1px solid var(--table-border-color); - padding: 0.5rem; -} - -.doc td.tableblock > .content > :first-child { - margin-top: 0; } .doc .tableblock p { -- 2.11.0