Replies: 8 comments 13 replies
-
If you add data to the I have a use-case that I'm trying to work through right now where I'd like to fetch data for an expanded row when expanding that row, but without needing to re-supply and build all of the markup. Pre-fetching all of the subRow data for a fully controlled/manual table is too expensive from a backend perspective. Haven't figured out a good solution yet... |
Beta Was this translation helpful? Give feedback.
-
The above is possible to obtain with a single table but it will be very painful to maintain, basically I'm doing the same and I'm just using subRow and useExpanded as mentioned before, the problem are footers. So I precompute all the totals at the beginning and all the footers are just normal rows and I explicitly mapping them as footer (giving them a different style) code it's quite ugly but if you play with it you can make it. I was looking into the same solution to have multiple tables but then they will go out of sync very easily and since you are using this prepareRow function that mutates the rows it's very hard I believe to extrapolate pieces and work with it. If you find any solution please share it! I'll be very interested in seeing something like the above working in a nice way |
Beta Was this translation helpful? Give feedback.
-
Maybe @tannerlinsley has a good way to do this? |
Beta Was this translation helpful? Give feedback.
-
@jlei523 - were you able to find a solution to this? I have a similar use case to build. |
Beta Was this translation helpful? Give feedback.
-
I have a similar use case , can you please suggest me the best approach to do it as im using react-table in all other pages of project so would be better if its possible with react table, i managed to render table inside a table but i couldnt add a logic that displays choosen subtables , apparently i used state to figure out which row is clicked but it displays just one and hides all others, please suggest me an idea to hide show multiple subtables |
Beta Was this translation helpful? Give feedback.
-
Seems, material-react-table which is based on this library has such feature "Detail Panel" to render different stuff, when row is expanded. I tried to research source code of that library, and I couldn't understand how does it bypass "subRows" property, because @tanstack/table, as I understand, depends on "getSubRows" property, when you implement row expanding. One more thing is that the developer of that lib is one of the devs of @tanstack/table. Maybe he could show some example how to do this? |
Beta Was this translation helpful? Give feedback.
-
I had the same issue and I just wanna share the hack that i did to solve this problem in a table for mobile screen size in a project I'm doing. I am new to this so please excuse my code thank you.
|
Beta Was this translation helpful? Give feedback.
-
What is the suggested way to do a I'm currently rendering like this:
|
Beta Was this translation helpful? Give feedback.
-
I'm using the latest react-table version.
I have a table with rows that expand into more rows:

Expanded state:

How can I recreate this?
Should I put another instance of react-table inside each row that expands? How can the sub-table instance share the same columns as the original table?
Thank you for your work Tanner!
Beta Was this translation helpful? Give feedback.
All reactions