Below is the example where only expansion is happening, but I want the row to collapse when you click it.
https://stackblitz.com/edit/angular-material-expandable-table-rows?file=app%2Ftable%2Ftable.component.ts
I want my table to be like this:
Please help.
Replace
(click)="expandedElement = row"
with
(click)="expandedElement === row? expandedElement = null : expandedElement = row"
https://stackblitz.com/edit/angular-material-expandable-table-rows-8ypyfu?file=app%2Ftable%2Ftable.component.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With