In this scenario, if the value
inside the <tr>
tag is null
for a cell, then the entire row should be displayed in a different color. The code I have written for this functionality is:
<ng-container *ngFor="let row of table?.rows; let rowIndex = index">
<tr [ngClass]="{'different-color': !row.data[0]}">
<td *ngFor="let value of row.data; let valueIndex = index;">
<ng-container *ngIf="row.edit_mode; else nonEditTable">
<input type="text" placeholder="Enter data" [value]="value
(change)="onTablevalueChanged($event.target.value, rowIndex, valueIndex)"
class="form-control">
</ng-container>
<ng-template #nonEditTable>
<span class="truncate table-truncate" [pTooltip]="value" tooltipZIndex="12000">
{{ value }}
</span>
</ng-template>
</td>
</tr>
<ng-container />