Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add className to a column header #894

Open
fredattack opened this issue Sep 4, 2019 · 1 comment
Open

add className to a column header #894

fredattack opened this issue Sep 4, 2019 · 1 comment

Comments

@fredattack
Copy link

hello,
Is there any way to add a className to a column header?
thx

@patorjk
Copy link
Collaborator

patorjk commented Sep 4, 2019

Right now you have to use the customHeadRender method and override the header component of the cell. You can see an example here: https://github.com/gregnb/mui-datatables/blob/master/examples/customize-columns/index.js

However, there's a PR in for a setCellHeaderProps feature (#889). If that gets approved, you'd be able to do it by adding the following to the options of the column:

setCellHeaderProps: () => ({className: "whatever-you-want"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants