Examples › Basic table properties

The DataTable component passes most properties of the underlying Mantine Table component through, and implements a number of additional ones. Try customizing some of them interactively below:

Name
Mission statement
Street address
City
State
Feest, Bogan and HerzogInnovate bricks-and-clicks metrics.21716 Ratke DriveStromanportWY
Cummerata - KuhlmanHarness real-time channels.6389 Dicki StreamSouth GateNH
Goyette IncProductize front-end web services.8873 Mertz RapidDorthysideID
Runte IncEngage synergistic infrastructures.2996 Ronny MountMcAllenMA
Goldner, Rohan and LehnerIncubate cross-platform metrics.632 Broadway AvenueNorth LouieWY
No records
return (
  <DataTable
    columns={[
      { accessor: 'name' },
      { accessor: 'missionStatement', width: 150 },
      { accessor: 'streetAddress' },
      { accessor: 'city' },
      { accessor: 'state' },
    ]}
    records={records}
  />
);

Things to keep in mind

  • row borders are shown by default; set withRowBorders={false} to hide them;
  • borderRadius is meant to round the corners of the outer table border, so it can only be set together with withTableBorder (TypeScript will complain otherwise);
  • horizontalSpacing, verticalSpacing, fz, borderRadius and shadow accept a key of the corresponding Mantine theme property (xs, sm, md, lg or xl) as well as any valid CSS value;
  • verticalAlign controls the vertical alignment of row cells and defaults to center; its effect is only visible when some cells span multiple lines (such as the Mission statement column above).

Other table properties

Since Mantine DataTable passes unknown properties down to the Mantine Table component, you can also use other Table properties, such as tabularNums (which applies font-variant-numeric: tabular-nums, so that numbers in different rows line up nicely).

Other examples cover related properties in more detail:

Head over to the next example to discover more features.

Mantine DataTable is used and trusted by