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

余生颓废 提交于 2019-12-18 07:19:09

问题


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 design. Can anyone help me how can we do this? I did not find any control to do it as header rendering is completely internal to component.


回答1:


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




回答2:


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?



来源:https://stackoverflow.com/questions/44689128/how-can-we-configure-the-header-of-ant-design-table-component

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!