I previously responded in this thread with a more elaborate answer: I want to show two accordions in a Material UI table body
Excerpt:
This is how I would solve it. This solution also works without Accordion.https://codesandbox.io/p/sandbox/great-hopper-skft3s
Basically, you can create a whole new table within the main table.
Add all the Accordion/nested logic within a single TableCell and add colSpan to match the item length of TableHead.
Then create a new Table within the Accordion and for each TableCell match the width of the columns from the TableHead.
Play around with padding: 0 to match TableHead and the nested content