Skip to content

Commit 1d4ea15

Browse files
author
Tim Bannister
committed
Add styles for complex layout tables
When there are tables that have rowspan header cells, avoid making those tables stripy (override Docsy here). Also customize how the table is laid out.
1 parent cd4cad9 commit 1d4ea15

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

assets/scss/_custom.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ body {
4545
}
4646
}
4747

48+
/* Complex table layout support */
49+
50+
.td-content, body.td-content {
51+
table.complex-layout {
52+
tbody tr,
53+
tbody tr:nth-of-type(2n+1) {
54+
/* Avoid stripes */
55+
background-color: initial;
56+
}
57+
tbody tr:not(:last-child) > td[colspan] {
58+
/* provide a visual break between rows */
59+
padding-bottom: 1.5em;
60+
}
61+
tbody > tr > th[scope="row"]:first-child {
62+
min-width: 9em;
63+
}
64+
tbody > tr > th[rowspan] {
65+
vertical-align: middle;
66+
}
67+
border-collapse: separate;
68+
border-spacing: 0 0;
69+
max-width: calc(max(min(100vw, 110%), 40vw));
70+
}
71+
}
4872

4973
/* Emphasize first paragraph of running text on site front page */
5074
body.td-home main[role="main"] > section:first-of-type .content p:first-child {

0 commit comments

Comments
 (0)