use top-oriented approach to add margin to table; remove top margin on table when...
authorDan Allen <dan@opendevise.com>
Sat, 12 Dec 2020 09:56:12 +0000 (02:56 -0700)
committerDan Allen <dan@opendevise.com>
Sat, 12 Dec 2020 09:56:12 +0000 (02:56 -0700)
src/css/doc.css

index d974fa7..9cbdef4 100644 (file)
 
 .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 {