From e1f15acecb98eee7daa07300cfd8dacccc93c461 Mon Sep 17 00:00:00 2001 From: mkurczewski Date: Thu, 3 Oct 2024 17:34:48 +0200 Subject: [PATCH] Table cell width fix --- libs/generic-view/ui/src/lib/table/table-cell.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/generic-view/ui/src/lib/table/table-cell.tsx b/libs/generic-view/ui/src/lib/table/table-cell.tsx index 463ee33f0a..86af1b6ee0 100644 --- a/libs/generic-view/ui/src/lib/table/table-cell.tsx +++ b/libs/generic-view/ui/src/lib/table/table-cell.tsx @@ -37,8 +37,13 @@ export const TableCell: APIFC = ({ 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);