How can we configure the Header of ant design table component?

后端 未结 2 465
醉酒成梦
醉酒成梦 2020-12-10 17:48

We have requirement where we need to show \'Hide/Show\' columns feature on the header of table and also we want to provide different color to the header of table in ant desi

相关标签:
2条回答
  • 2020-12-10 18:38

    What I tried to resolve the background colour issue of header is overwrite the ant style class as below

    thead[class*="ant-table-thead"] th{
      background-color: yellow !important;
    }
    

    I am not sure if this is the correct way of doing or not. antd should provide the property on Table to configure the header style.

    Is there any other better way to do it?

    0 讨论(0)
  • 2020-12-10 18:52

    You can use the <Table.Column title={<...any react node...>}> attribute in combination with ordinary CSS.

    0 讨论(0)
提交回复
热议问题