Examples › Additional styling
There are more ways to style a Mantine
DataTable component besides setting its
basic properties and
column properties or customizing it’s
border colors.
You can specify a className that will target the Mantine DataTable component root:
You can provide a style object that will target the Mantine DataTable component root:
You can provide
an sx property that will target the
Mantine DataTable component root:
The sx property can also point to a function that receives the current theme as its argument:
When styling with class names, you may need to increase selector specificity to override the default styling.
See
this StackOverflow question for more information.
You can specifically target the component root, its header, footer and/or its pagination with different classNames:
You can specifically target the component root, its header, footer and/or its pagination with a styles property:
The styles property can also point to a function that receives the current theme as its argument:
You can style rows with rowClassName, rowStyle and rowSx properties. They work the same way as className, style and sx, but target rows instead of the component root.