Skip to content

Commit 0d93ad8

Browse files
committed
add support for table borders and stripes
1 parent 53011c3 commit 0d93ad8

File tree

1 file changed

+64
-10
lines changed

1 file changed

+64
-10
lines changed

src/css/doc.css

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@
153153
float: left;
154154
}
155155

156+
.doc .stretch {
157+
width: 100%;
158+
}
159+
156160
.doc .underline {
157161
text-decoration: underline;
158162
}
@@ -190,20 +194,70 @@
190194
max-width: 100%;
191195
}
192196

193-
.doc table.stretch {
194-
width: 100%;
197+
.doc table.tableblock th,
198+
.doc table.tableblock td {
199+
padding: 0.5rem;
195200
}
196201

197-
.doc table.tableblock thead th {
198-
border-bottom: 2.5px solid var(--table-border-color);
199-
padding: 0.5rem;
202+
.doc table.tableblock,
203+
.doc table.tableblock > * > tr > * {
204+
border: 0 solid var(--table-border-color);
200205
}
201206

202-
.doc table.tableblock td,
203-
.doc table.tableblock > :not(thead) th {
204-
border-top: 1px solid var(--table-border-color);
205-
border-bottom: 1px solid var(--table-border-color);
206-
padding: 0.5rem;
207+
.doc table.grid-all > * > tr > * {
208+
border-width: 1px;
209+
}
210+
211+
.doc table.grid-cols > * > tr > * {
212+
border-width: 0 1px;
213+
}
214+
215+
.doc table.grid-rows > * > tr > * {
216+
border-width: 1px 0;
217+
}
218+
219+
.doc table.grid-all > thead th,
220+
.doc table.grid-rows > thead th {
221+
border-bottom-width: 2.5px;
222+
}
223+
224+
.doc table.frame-all {
225+
border-width: 1px;
226+
}
227+
228+
.doc table.frame-ends {
229+
border-width: 1px 0;
230+
}
231+
232+
.doc table.frame-sides {
233+
border-width: 0 1px;
234+
}
235+
236+
.doc table.frame-none > colgroup + * > :first-child > *,
237+
.doc table.frame-sides > colgroup + * > :first-child > * {
238+
border-top-width: 0;
239+
}
240+
241+
.doc table.frame-none > :last-child > :last-child > *,
242+
.doc table.frame-sides > :last-child > :last-child > * {
243+
border-bottom-width: 0;
244+
}
245+
246+
.doc table.frame-none > * > tr > :first-child,
247+
.doc table.frame-ends > * > tr > :first-child {
248+
border-left-width: 0;
249+
}
250+
251+
.doc table.frame-none > * > tr > :last-child,
252+
.doc table.frame-ends > * > tr > :last-child {
253+
border-right-width: 0;
254+
}
255+
256+
.doc table.stripes-all > tr,
257+
.doc table.stripes-odd > tbody > tr:nth-of-type(odd),
258+
.doc table.stripes-even > tbody > tr:nth-of-type(even),
259+
.doc table.stripes-hover > tbody > tr:hover {
260+
background: var(--admonition-background);
207261
}
208262

209263
.doc .halign-left {

0 commit comments

Comments
 (0)