T
TanStack3y ago
foreign-sapphire

How to use colspan or something like that?

Is there a way to use colspan? Or use column group but with only one header? Doc example: https://tanstack.com/table/v8/docs/examples/react/column-groups
No description
3 Replies
foreign-sapphire
foreign-sapphireOP3y ago
What I would like it to be
No description
rival-black
rival-black3y ago
If your column names are static, you can delete all the content of <thead /> an just manually write a pair of <th /> with your column names. Maybe it's not the accurate solution, but it's the cleanest and the shortest.
environmental-rose
environmental-rose3y ago
You could just render headerGroups[0] ... Just be aware that some features only operate on leaf columns by default so if you want to add column filtering, sorting etc you'll need to write some extra code to operate on the leaf columns

Did you find this page helpful?