feat: Scrollable, non-overflowing tables

This commit is contained in:
Steffo committed 2026-08-11 05:14:37 +02:00
1 parent 736f838dd0
commit d1598a8917
2 files changed
+16 -4

No files matched your search

+5 -3
View File
@@ -762,9 +762,11 @@ export const getReactCustomHtmlParser = (
if (name === 'table') {
return (
<table {...props} className={css.Table}>
{renderChildren()}
</table>
<div className={css.TableContainer}>
<table {...props} className={css.Table}>
{renderChildren()}
</table>
</div>
);
}
if (name === 'th') {
+11 -1
View File
@@ -302,9 +302,17 @@ export const HorizontalRule = style([
},
]);
export const Table = style([
export const TableContainer = style([
DefaultReset,
MarginSpaced,
{
overflowX: 'auto',
maxWidth: '100%',
}
])
export const Table = style([
DefaultReset,
{
borderCollapse: 'collapse',
},
@@ -317,6 +325,7 @@ export const Th = style([
border: `${config.borderWidth.B300} solid ${color.SurfaceVariant.ContainerLine}`,
backgroundColor: color.SurfaceVariant.Container,
color: color.SurfaceVariant.OnContainer,
minWidth: toRem(100),
}
]);
@@ -327,5 +336,6 @@ export const Td = style([
border: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`,
backgroundColor: color.Surface.Container,
color: color.Surface.OnContainer,
minWidth: toRem(100),
}
]);