DataTable expanded rows alignment #2124
-
Hello, we are working with PrimeReact Datatables for 2 years now. The client requests the expanded "subtable" to be aligned with the main rows. So for example, having columns of names, emails and phone numbers, and when you expand a certain row, the expanded elements underneath should be aligned with their main ones. So names under names, emails under emails and so on. How can this be achieved? And also, can it be combined with resizing and reordering of columns? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That won't work with the default expandable feature. If you were to ask me to build this, I would say it's a bad idea. However, we all know how clients are... So, I would implement it myself based on the normal Datatable. The parent elements would get an Use the What's a bit tricky is the fact that you want to sort them. Would you like to keep them together with the parent, or do you want to handle them as "normal" items? |
Beta Was this translation helpful? Give feedback.
Here's a short, not tested and AI generated code block to give you a brief idea what I'm talking about:
Expand to see code:
AI generated code to get an idea