<table mat-table [dataSource]="instructors" class="mat-elevation-z8 full-width-table">

    <!--- Note that these columns can be defined in any order.
          The actual rendered columns are set as a property on the row definition" -->
  
    <!-- Name Column -->
    <ng-container matColumnDef="name">
      <th mat-header-cell *matHeaderCellDef> Jméno </th>
      <td mat-cell *matCellDef="let element"> {{element.firstname}} {{element.lastname}} </td>
    </ng-container>

    <!-- Email Column -->
    <ng-container matColumnDef="email">
        <th mat-header-cell *matHeaderCellDef> Email </th>
        <td mat-cell *matCellDef="let element"> {{element.email}} </td>
      </ng-container>
  
    <!-- Age Column -->
    <ng-container matColumnDef="age">
      <th mat-header-cell *matHeaderCellDef> Věk </th>
      <td mat-cell *matCellDef="let element"> {{element.birthdate  | date:"d.M.Y"}} </td>
    </ng-container>

    <!-- City Column -->
    <ng-container matColumnDef="city">
        <th mat-header-cell *matHeaderCellDef> Bydliště </th>
        <td mat-cell *matCellDef="let element"> {{element.addressCity}} </td>
      </ng-container>

    <!-- Link Column -->
    <ng-container matColumnDef="link">
      <th mat-header-cell *matHeaderCellDef> Profil </th>
      <td mat-cell *matCellDef="let element"><a mat-flat-button routerLink="/{{profileLink}}/{{element.ID}}"><mat-icon color="primary">account_box</mat-icon></a></td>
    </ng-container>

    <!-- Footer -->
    <ng-container matColumnDef="footer">
        <td mat-footer-cell *matFooterCellDef colspan="4" class="table-item-counter">
            Celkem instruktorů: {{instructors.length}}
        </td>
    </ng-container>
  
    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
    <tr mat-footer-row *matFooterRowDef="['footer']" class="footer-row"></tr>
</table>
