Skip to content

Commit 8de4246

Browse files
committed
docs: fix table border-radius rendering
Tables weren't showing rounded corners because `border-collapse: collapse` prevents border-radius from working. Changes: - Use `border-collapse: separate` with `border-spacing: 0` - Add outer border to table element - Remove duplicate borders between cells (only right/bottom on cells) - Explicitly set border-radius on corner cells (first/last th/td) - Add `overflow: hidden` to enforce rounded corners Tables now have properly rounded corners matching other UI elements.
1 parent 431b7c0 commit 8de4246

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

docs/theme/custom.css

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,52 @@ pre > code {
261261

262262
/* Tables */
263263
table {
264-
border-collapse: collapse;
264+
border-collapse: separate;
265+
border-spacing: 0;
265266
width: 100%;
266267
margin: 1.1em 0;
267268
background: var(--color-background-secondary) !important;
269+
border: 1px solid var(--color-border);
268270
border-radius: var(--radius-md);
271+
overflow: hidden;
269272
}
270273
table thead {
271274
background: color-mix(in srgb, var(--color-background-secondary), white 8%);
272-
border-bottom: 2px solid var(--color-border) !important;
275+
}
276+
table thead tr:first-child th:first-child {
277+
border-top-left-radius: var(--radius-md);
278+
}
279+
table thead tr:first-child th:last-child {
280+
border-top-right-radius: var(--radius-md);
281+
}
282+
table tbody tr:last-child td:first-child {
283+
border-bottom-left-radius: var(--radius-md);
284+
}
285+
table tbody tr:last-child td:last-child {
286+
border-bottom-right-radius: var(--radius-md);
273287
}
274288
table th,
275289
table td {
276290
padding: 0.75em 1em;
277-
border: 1px solid var(--color-border) !important;
291+
border-right: 1px solid var(--color-border);
292+
border-bottom: 1px solid var(--color-border);
278293
text-align: left !important;
279294
color: var(--color-text) !important;
280295
}
296+
table th:first-child,
297+
table td:first-child {
298+
border-left: none;
299+
}
300+
table th:last-child,
301+
table td:last-child {
302+
border-right: none;
303+
}
304+
table thead th {
305+
border-bottom: 2px solid var(--color-border) !important;
306+
}
307+
table tbody tr:last-child td {
308+
border-bottom: none;
309+
}
281310
table th {
282311
font-weight: 700;
283312
font-size: 1.05em;

0 commit comments

Comments
 (0)