I am using Angular 4 to display a set of columns dynamically. So, only at runtime I would know the number of columns and those need to be shown in a table.

This is how the code to show columns looks like -

```
<tr *ngFor="let result of results">            
                <td *ngFor="let col of searchResultColumnNames"  >
                  {{ result[col] }}
                </td>
</tr>

```

Now, I need to add a condition to it. If column name is a certain value like 'refId', then it should not be displayed.

So, I did as follows 

```
<tr *ngFor="let result of results">            
                <td *ngFor="let col of searchResultColumnNames"  >
                   <div *ngIf='col !== refId'> {{ result[col] }}</div>
                </td>
</tr>

```

This does hide the column value, however, an empty td is created, which is not needed.

So, I tried putting \*ngIf in the (alongside \*ngFor), but it seems that is not allowed.

How can I render the results dynamically, and also hide certain columns without creating empty td elements