Column Resizing

Let users adjust column widths by dragging header dividers — or double-click to auto-fit.

Enable resizing

Set columnResizing to let users drag header dividers. Double-click a handle to auto-fit that column to its content.

React TSX
<SimpleTable columns={columns} rows={rows} height="400px" columnResizing={true} />

Persist column widths

Use onColumnWidthChange to save widths whenever the user resizes or auto-fits a column.

React TSX
const handleColumnWidthChange = (headers) => {
const widths = Object.fromEntries(
headers.map((h) => [h.accessor, h.width])
);
localStorage.setItem("columnWidths", JSON.stringify(widths));
};
<SimpleTable
columnResizing
columns={columns}
rows={rows}
onColumnWidthChange={handleColumnWidthChange}
/>

Example

Drag dividers or double-click to auto-fit. This demo saves widths to localStorage.

Props

Column Resizing Configuration

PropertyRequiredDescriptionExample
columnResizing
boolean
Optional
Enables dragging header dividers to resize columns. Double-click a handle to auto-fit that column to its content.
Optional
Fires after resize or double-click auto-size with the updated column defs. Use it to persist widths.