diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index f16399575..23b1c9a6e 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;