Theme

Examples › Pinning the last column

You may have noticed that when you are using row selection and the table needs to scroll horizontally, the checkbox column is always visible. This is because the checkbox column is pinned to the left side of the table.
In the same way, pinning the last column to the right side of the table could be useful when you have a table with many columns and you want to make sure the last column is always visible, even when the table is scrolled horizontally. For instance, you could use this feature to ensure that the row actions are always visible.
You can achieve this by setting the pinLastColumn DataTable prop to true:
DustinSawaynIndustrialRunolfsdottir - CummerataMissouri CityKY102 Konopelski GreensLeverage one-to-one methodologies.
EarnestHellerHealthJohnston LLCHartfordKY230 Julie LakeTransition wireless initiatives.
SheilaKesslerAutomotiveSipes IncTwin FallsMT280 Rigoberto DivideStrategize magnetic vortals.
BrayanMacejkovicBabyJohnston LLCHartfordKY230 Julie LakeTransition wireless initiatives.
AssuntaAnkundingBooksCrist and SonsAttleboroWV3387 Blick TurnpikeRevolutionize out-of-the-box infomediaries.
No records
Here is the code:
return (
<DataTable
pinLastColumn // 👈 make sure the last column is always visible
withBorder
columns={[
{ accessor: 'firstName', noWrap: true },
{ accessor: 'lastName', noWrap: true },
{ accessor: 'department.name', title: 'Department' },
{ accessor: 'department.company.name', title: 'Company', noWrap: true },
{ accessor: 'department.company.city', title: 'City', noWrap: true },
{ accessor: 'department.company.state', title: 'State' },
{ accessor: 'department.company.streetAddress', title: 'Address', noWrap: true },
{ accessor: 'department.company.missionStatement', title: 'Mission statement', noWrap: true },
{
accessor: 'actions',
title: <Box mr={6}>Row actions</Box>,
textAlignment: 'right',
render: (employee) => (
// action cells custom rendering...
),
},
]}
records={records}
/>
);
Head over to the next example to discover more features.

Mantine DataTable is trusted by

MIT LicenseSponsor the author
Built by Ionut-Cristian Florescu and these awesome people.
Please sponsor the project if you find it useful.
GitHub StarsNPM Downloads