ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

Internal issue 2914 - IcDataTable column maxWidth not working if table width not specified

Open ticket-sync[bot] opened this issue 1 year ago • 2 comments

If the {{width}} prop of an IcDataTable isn’t set, the {{maxWidth}} you give to any {{columnWidth}} doesn’t take effect.

Code example here https://stackblitz.com/edit/5ly68d-ogmxdx?file=src%2Fapp.tsx&hideExplorer=1

ticket-sync[bot] avatar Oct 25 '24 14:10 ticket-sync[bot]

We worry that the 'table-layout: auto' that is applied in CSS when table width isn't set might inherently disable the max-width behaviour of columns. This could turn out to be an impossible / overly complicated fix

GCHQ-Developer-299 avatar Sep 15 '25 09:09 GCHQ-Developer-299

From looking into it the issue seems to be that when a width for the table is set (i.e. at 100% or a fixed pixel amount) and using table-layout: auto , it ignores the maximum values set for the individual columns in order to fit the table to the size set. Looking online at other tables, it doesn't seem like this is abnormal behavior for these properties.

jd3267 avatar Nov 05 '25 17:11 jd3267