Skip to content

Commit 63f9341

Browse files
authored
striped variant and footer totals row (#45)
1 parent 22af5bf commit 63f9341

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed

preview-src/index.adoc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,63 @@ Varying the delimiter line length allows the parser to distinguish one block fro
759759
[#tables]
760760
== Tables
761761

762+
[frame=none, grid=rows,%autowidth.stretch]
763+
.Default
764+
|===
765+
|Column 1, header row |Column 2, header row |Column 3, header row
766+
767+
|Cell in column 1, row 2
768+
|Cell in column 2, row 2
769+
|Cell in column 3, row 2
770+
771+
|Cell in column 1, row 3
772+
|Cell in column 2, row 3
773+
|Cell in column 3, row 3
774+
|===
775+
776+
[%autowidth.stretch,stripes=even]
777+
.Striped
778+
|===
779+
|Header |Header |Header |Header
780+
781+
|Cell
782+
|Cell
783+
|Cell
784+
|Cell
785+
786+
|Cell
787+
|Cell
788+
|Cell
789+
|Cell
790+
791+
|Cell
792+
|Cell
793+
|Cell
794+
|Cell
795+
|===
796+
797+
798+
[%footer%autowidth.stretch]
799+
.Footer
800+
|===
801+
|Header |Header |Header |Header
802+
803+
h|Item
804+
|2
805+
|1
806+
|5
807+
808+
h|Item
809+
|2
810+
|1
811+
|5
812+
813+
h|Total
814+
|4
815+
|2
816+
|10
817+
|===
818+
762819
.Basic table
763820
[cols="3*"]
764821
|===

src/css/doc.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,12 @@
315315
margin-top: 0;
316316
}
317317

318-
.doc table.tableblock th,
318+
.doc table.tableblock th {
319+
padding: var(--ds-space-1) var(--ds-space-2);
320+
}
321+
319322
.doc table.tableblock td {
320-
padding: calc(13 / var(--rem-base) * 1rem) var(--ds-space-2);
323+
padding: var(--ds-space-1h) var(--ds-space-2);
321324
}
322325

323326
.doc table.tableblock,
@@ -326,7 +329,7 @@
326329
}
327330

328331
.doc table.grid-all > * > tr > * {
329-
border-width: 1px;
332+
border-bottom-width: 1px;
330333
}
331334

332335
.doc table.grid-cols > * > tr > * {
@@ -345,7 +348,7 @@
345348
}
346349

347350
.doc table.frame-all {
348-
border-width: 1px;
351+
border-bottom-width: 0;
349352
}
350353

351354
.doc table.frame-ends {
@@ -390,6 +393,10 @@
390393
background: var(--table-footer-background);
391394
}
392395

396+
.doc table.tableblock > tfoot > tr > * {
397+
border-bottom-width: 0;
398+
}
399+
393400
.doc .halign-left {
394401
text-align: left;
395402
}

src/css/vars.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
--quote-attribution-font-color: var(--ds-text-tertiary);
9292
--sidebar-background: var(--ds-background-body);
9393
--table-border-color: var(--ds-divider);
94-
--table-stripe-background: var(--ds-background-body);
95-
--table-footer-background: linear-gradient(to bottom, var(--ds-background-level1) 0%, var(--ds-background-body) 100%);
94+
--table-stripe-background: var(--ds-background-level1);
95+
--table-footer-background: var(--ds-background-level1);
9696
/* toc */
9797
--toc-font-color: var(--ds-text-secondary);
9898
--toc-menu-font-weight: var(--body-font-weight-bold);

0 commit comments

Comments
 (0)