Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 526.4k

Angular Material Table

Jul 7 2024 1:08 PM

Hi

  How the below code works

<td mat-cell *matCellDef="let element">
        {{element[col]}}
      </td>

<ng-container [matColumnDef]="col" *ngFor="let col of displayedColumns">
      <th mat-header-cell *matHeaderCellDef>
        {{col}}
      </th>
      <td mat-cell *matCellDef="let element">
        {{element[col]}}
      </td>
    </ng-container>

Thanks


Answers (1)