From 839866044cef86ee7a9a915b950af0cb0661e66f Mon Sep 17 00:00:00 2001 From: Nick Troshkov Date: Sun, 19 Oct 2025 09:47:08 +0200 Subject: [PATCH] feat(Table): make `table-layout: auto` the default --- src/components/Table/Table.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index f1639957..23b1c9a6 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -404,6 +404,11 @@ interface CommonTableProps size?: TableSize; showHeader?: boolean; rowHeight?: string; + /** + * Apply `table-layout: fixed`, making table follow assigned dimensions strictly, + * at the expense of cutting off content that doesn't fit + */ + fixedLayout?: boolean; } type SelectReturnValue = { @@ -576,6 +581,7 @@ const Table = forwardRef( size = "sm", showHeader = true, rowHeight, + fixedLayout = false, ...props }, ref @@ -629,6 +635,7 @@ const Table = forwardRef( {showHeader && ( @@ -765,11 +772,15 @@ const SelectAllCheckbox: FC = ({ ); }; -const StyledTable = styled.table` +interface StyledTableProps { + $fixed: boolean; +} + +const StyledTable = styled.table` width: 100%; border-collapse: collapse; overflow: hidden; - table-layout: fixed; + ${({ $fixed }) => $fixed && "table-layout: fixed;"} @media (max-width: 768px) { border: none;