Reputation: 109
I have a table where it shows list of employee Information in a table having few columns, I want to display 'No Data found', in a single row when there is no data coming from the server in angular 6
Upvotes: 0
Views: 373
Reputation: 1737
Try this
<tbody>
<tr *ngIf="location">
<td>{{location.name}}</td>
<td>{{location.id}}</td>
</tr>
<tr *ngIf="!location">
<td colspan="2">No Data found</td>
</tr>
</tbody>
Upvotes: 1
Reputation: 10717
Use colspan
:
<tr *ngIf="list.length == 0">
<td colspan="number_of_columns_in_header"> No record found </th>
</tr>
Upvotes: 0