From 79a93ca4ebcd73b37a12cb21f5a4b17bf0d47524 Mon Sep 17 00:00:00 2001 From: Nick Troshkov Date: Sun, 19 Oct 2025 09:47:08 +0200 Subject: [PATCH 1/2] feat(Table): make `table-layout: auto` the default --- src/components/Table/Table.module.css | 7 +++++++ src/components/Table/Table.tsx | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/Table/Table.module.css b/src/components/Table/Table.module.css index 00e5fd0ac..bd4c8f7b5 100644 --- a/src/components/Table/Table.module.css +++ b/src/components/Table/Table.module.css @@ -18,6 +18,13 @@ width: 100%; overflow: visible; border-collapse: collapse; +} + +.table__table_layout_auto { + table-layout: auto; +} + +.table__table_layout_fixed { table-layout: fixed; } diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 1fa57f9ba..f2a66b749 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -291,6 +291,18 @@ const Thead = ({ ); }; +const tableVariants = cva(styles.table__table, { + variants: { + layout: { + auto: styles.table__table_layout_auto, + fixed: styles.table__table_layout_fixed, + }, + }, + defaultVariants: { + layout: 'auto', + }, +}); + const rowVariants = cva(styles.table__row, { variants: { isSelectable: { @@ -380,6 +392,7 @@ interface CommonTableProps extends Omit< rowHeight?: string; resizableColumns?: boolean; mobileLayout?: MobileLayoutProp; + tableLayout?: 'auto' | 'fixed'; } type SelectReturnValue = { @@ -586,6 +599,7 @@ const Table = forwardRef( resizableColumns, mobileLayout = 'list', className, + tableLayout = 'auto', ...props }, ref @@ -848,7 +862,7 @@ const Table = forwardRef( {showHeader && ( Date: Wed, 22 Jul 2026 15:29:38 +0200 Subject: [PATCH 2/2] chore: add changelog entry --- .changeset/heavy-donuts-agree.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/heavy-donuts-agree.md diff --git a/.changeset/heavy-donuts-agree.md b/.changeset/heavy-donuts-agree.md new file mode 100644 index 000000000..07b366462 --- /dev/null +++ b/.changeset/heavy-donuts-agree.md @@ -0,0 +1,7 @@ +--- +"@clickhouse/click-ui": patch +--- + +`Table` accepts a new `tableLayout` prop controlling its layout. Possible values: `'auto'`, `'fixed'`. Changes the default from +`table-layout: fixed` to `table-layout: auto`, making tables adjust to their contents better. When overflown, tables gain horizontal scroll +instead of squishing their contents.