Is there a way to get the header *labels* ? #4820
Unanswered
changyeamoon
asked this question in
Q&A
Replies: 1 comment
-
You can add the label into column declare module "@tanstack/table-core" {
interface ColumnMeta<TData extends RowData, TValue> {
label?: string;
}
} Then, you can define a label for each column. columnHelper.accessor("mykey", {
cell: // your implementation,
header: // your implementation,
footer: // your implementation,
meta: {
label: "My Key Label",
},
}), Then, you can get it through the Hope it is useful. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I see that we can grab the ids, but is there a way to grab the labels? We were able to do this in v7, but not seeing anything in the typing that would indicate we can do this in v8
heres how to grab the ids
table .getHeaderGroups() .map((headerGroup) => headerGroup.headers) .flat().find((header) => header.id === 'headerId')?.id
Beta Was this translation helpful? Give feedback.
All reactions