I am currently facing a challenge with an HTML table that has data imported using *ngFor. Some rows in the table have 12 pieces of data, resulting in 12 columns, while others only have 2 pieces of data and therefore only 2 columns.
My attempt to use empty-cells: show in CSS did not work as expected because the extra cells I wanted to display remain hidden due to lack of data.
Adding extra empty <td>
elements also did not solve the issue since using *ngFor caused these empty cells to be added at the end of every row, leading to uneven columns.
To illustrate this problem, I created a demo on StackBlitz. In this example, my goal is to give all cells a grey background even if they are empty.
I am seeking advice on the best approach to achieve this desired outcome. What would be the most effective solution?