I want to use Angular material table in my app and apply custom styling. The Rows should be separated by 8px while also supporting expandable rows. My desired styling for expanded rows looks something like this:
I have forked the Angular material table example for expandable rows here: https://stackblitz.com/edit/angular-24aegb
Changes I have made are: used border-spacing to create the margin between the rows and removed the borders.
table {
width: 100%;
border-collapse: separate;
border-spacing: 0 8px !important;
}
Problem: the detail-row is a table row, which means it is separated from its parent-row as well. Is there a way to overwrite the spacing for these specific rows? If not, is there any workaround for expandable rows or the spacing between the rows that I could use in order to achieve the desired styling?