Typescript
tab1: {
headings: ['Col 1', 'Col 2', 'Col 3', 'Col 4'],
content: [
{
col1: 'name of row object',
col2: `<div style="width: 550px; height: 40px; border: 1px solid black"></div>`,
col3: 'col3'
}
]
},
HTML (I have removed css classes for ease of reading)
<table>
<thead>
<tr>
<th *ngFor="let heading of visibleData.headings">
<span>{{heading}}</span>
</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let row of visibleData.content" >
<tr>
<td *ngFor="let column of row"><div [innerHtml]="column"></div></td>
<td><div style="width: 550px; height: 40px; border: 1px solid red"></div></td>
</tr>
</ng-container>
</tbody>
</table>
This is a screenshot of the DOM. It shows the passed in version being empty while the hard coded version has the html needed.
Here is a screenshot output table. As it is in the dom, the html that is passed in does not display correctly but the html that was written directly to the 2nd td displays correctly.
Thanks for your help!