Apparently this question has already been answered here: Generating Two Table Rows With *ngFor
I'm trying to achieve a HTML table, whose tr
elements each have two available rows. I'm integrating this with an app using the Angular framework and bootstrap. I want to avoid nested tables as they can be really messy.
The reason I want to do this is so that I can have all my fields in the first row, and then a second row which appears empty, but will be populated with a success / error message when appropriate.
<!-- Example code -->
<table>
<thead>
<th>Field 1</th>
<th>Field 2</th>
<th>Field 3</th>
</thead>
<tbody>
<tr *ngFor="row in rows">
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
and each tr
looks something like this:
[Field 1] [Field 2] [Field 3]
What I want to achieve is for each tr
to look like this:
[Field 1] [Field 2] [Field 3]
[ - second row inside tr -- ]