Skip to content

Commit

Permalink
Table cell width fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurczewski committed Oct 3, 2024
1 parent baaec75 commit e1f15ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libs/generic-view/ui/src/lib/table/table-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ export const TableCell: APIFC<undefined, TableCellConfig> = ({
export const Cell = styled.td<{
$width?: number | string
}>`
--cell-width: ${({ $width }) =>
$width ? (typeof $width === "string" ? $width : `${$width}px`) : "auto"};
--cell-width: ${({ $width }) => {
return $width !== undefined
? isNaN(Number($width))
? $width
: `${$width}px`
: "auto"
}};
width: var(--cell-width);
max-width: var(--cell-width);
Expand Down

0 comments on commit e1f15ac

Please sign in to comment.