'How to change the color of entire row if value is missing. inside <td> element. Here value is coming from api which we are looping through and getting
Here if the value inside <tr> comes null for the cell then the entire row should have different color. My code look like this:
<ng-container *ngFor="let row of table?.rows; let rowIndex = index">
<tr>
<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 />
It should be coming like this, as the row first value is missing else it should be white.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
