Group by row using shadcn tanstack table
I couldn't find any good docs or example to build this kind of table, can anyone please help me

3 Replies
continuing-cyan•16mo ago
Just throwing out some ideas (from mobile, so excuse the lack of thoroughness): maybe using the column visibility API could be helpful?
I would try something like:
define all 4 columns (name,email,message,date)
group by date (but depending on the format of the date in your data, make a getGroupingValue for that column like (date) => yearAndMonth(date)
Then finally how to make the subrows not show the date. That is not something I've done, but I imagine using column visibility somehow could be useful
eastern-cyanOP•16mo ago
@Joel Can you show me via code if you can please ( I'm using the shadcn data table in nextjs )
continuing-cyan•16mo ago
Sorry, neither shadcn or next are part of my expertise.
If you post the code you have maybe I can suggest where to make changes.