[column-visibility] How to display the header of a column instead of the column.id
?
#4857
Unanswered
marceloverdijk
asked this question in
Q&A
Replies: 3 comments 4 replies
-
Just don't use column.id. use column.columnDef.header |
Beta Was this translation helpful? Give feedback.
3 replies
-
as @IudexSoren said, you can use
Then you can access it:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I ran into the same problem and ended-up using flexRender(column.columnDef.header, {
table,
column,
header: {column} as Header<unknown, unknown>,
}) You can replace Since we don't have direct access to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking at https://tanstack.com/table/v8/docs/examples/react/column-visibility
the box to show the columns to toggle uses:
and in particular
column.id
to display the label.But how to use actual header value here? E.g. in this example
Last Name
instead oflastName
...Beta Was this translation helpful? Give feedback.
All reactions