FrontendInterviews.dev

Loading problem…

127. Data Table - Column Resizing

Hard•
Acceptance: 35.00%
•
🔓3/3 Pro unlocks today

This problem builds on data-table. Complete that first, then load your solution to continue.

Build a production-ready Data Table component that extends the base Data Table with column resizing functionality. This builds on top of the sorting feature from the base Data Table.

Requirements

1. Column Resizing

  • Drag column borders to resize
  • Maintain minimum column width
  • Visual feedback during resize
  • Update table layout dynamically

3. Data Structure

interface Column {
  key: string;
  label: string;
  sortable?: boolean;
  resizable?: boolean;
  width?: number;
  minWidth?: number;
}

interface DataTableProps {
  data: Record<string, any>[];
  columns: Column[];
}

Example Usage

<DataTable 
  data={data} 
  columns={columns}
/>

Constraints

  • Column resizing should update table layout dynamically
  • Use mouse events for resize interactions
  • Maintain minimum column width constraints