diff --git a/packages/grafana-ui/src/components/Table/TableNG/TableNG.test.tsx b/packages/grafana-ui/src/components/Table/TableNG/TableNG.test.tsx index 4a9aa0e8444..f9cc3c10005 100644 --- a/packages/grafana-ui/src/components/Table/TableNG/TableNG.test.tsx +++ b/packages/grafana-ui/src/components/Table/TableNG/TableNG.test.tsx @@ -1179,8 +1179,8 @@ describe('TableNG', () => { const cells = container.querySelectorAll('[role="gridcell"]'); const cellStyles = window.getComputedStyle(cells[0]); - // In the getStyles function, when textWrap is true, whiteSpace is set to 'break-spaces' - expect(cellStyles.getPropertyValue('white-space')).toBe('break-spaces'); + // In the getStyles function, when textWrap is true, whiteSpace is set to 'normal' + expect(cellStyles.getPropertyValue('white-space')).toBe('normal'); }); }); diff --git a/packages/grafana-ui/src/components/Table/TableNG/TableNG.tsx b/packages/grafana-ui/src/components/Table/TableNG/TableNG.tsx index 96015632e04..e24e6cf6c9b 100644 --- a/packages/grafana-ui/src/components/Table/TableNG/TableNG.tsx +++ b/packages/grafana-ui/src/components/Table/TableNG/TableNG.tsx @@ -476,7 +476,7 @@ export function TableNG(props: TableNGProps) { avgCharWidth, defaultLineHeight, defaultRowHeight, - TABLE.CELL_PADDING * 2, + TABLE.CELL_PADDING, fieldsData ); }, @@ -950,7 +950,7 @@ const getStyles = (theme: GrafanaTheme2, textWrap: boolean) => ({ cell: css({ '--rdg-border-color': theme.colors.border.medium, borderLeft: 'none', - whiteSpace: `${textWrap ? 'break-spaces' : 'nowrap'}`, + whiteSpace: `${textWrap ? 'normal' : 'nowrap'}`, wordWrap: 'break-word', overflow: 'hidden', textOverflow: 'ellipsis',