# Angular – How to use ngif-else with table to display td based on condition

I am working on a web project using angular-7 as the frontend. I displayed the data as shown below:

driver.component.html

<tr *ngFor="let drivers of driver">
<td>{{ drivers.driver_id }}</td>
<td>{{ drivers.driver_name }}</td>
<td>{{ drivers.status }}</td>
</tr>


I want to apply *ngIf-else statement to drivers.status. If it is 1, it should display Treated and should be in green colour, else it should display Pending, and should be in red colour.

How do I achieve this?

Source: New feed
Source Url Angular – How to use ngif-else with table to display td based on condition