Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular HTML TD class

Tags:

angular

I have the below td with 10 columns. I want to underline first 4 columns but not underline remaining 6. Can anyone help me how to accomplish this.

<tr>
  <td *ngFor="let column of Columns; let i=index;" class="cell-underline">
    <span>{{column.value}}</span>
  </td>
<tr>
like image 285
user2654283 Avatar asked May 17 '26 17:05

user2654283


1 Answers

You should use the directive ngFor and add a condition class. This is an example for you:

<td *ngFor="let column of columns; index as i;">
  <span [ngClass]="{'underline': i < 5 }">{{column.value}}</span>
</td>
like image 64
Leccho Avatar answered May 19 '26 12:05

Leccho