Reputation: 833
When making a Table in Ant Design, there are always gray divider lines between each row. Is there a way to style these divider lines or completely remove them from the table?
Upvotes: 4
Views: 9555
Reputation: 1947
You need to provide headerSplitColor: 'transparent'
, for Table in your ConfigProvider
which is the recommened approch to customising theme in Antd,
lean more here : https://ant.design/docs/react/customize-theme
<ConfigProvider
theme={{
components: {
Table: {
headerSplitColor: 'transparent'
}
}
}}
>
// your code
</ConfigProvider>
Upvotes: 2
Reputation: 1
Maybe it will help someone: I had a task to remove the line (border bottom) in the last row of the table. The solution is:
.ant-table-tbody > tr:last-child > td {
border: none
}
style for all Table.
Upvotes: 0
Reputation: 5380
You should override the antd
table styles
.ant-table-tbody > tr > td {
border: none
}
Upvotes: 5
Reputation: 6554
if you are using css-modules in your Nextjs application, you can override table styles like this:
in them component file:
import classes from './Comp.module.css';
function Comp(props){
...
return (
<Table
...
className={classes.customTable}
/>
)
}
and in the Comp.module.css file:
.customTable .ant-table-tbody > tr > td{
border: none
}
Upvotes: 0