0

I would like to click on any cell of my mat-table and get the row and column of my cell.

I know that with this code I get the clicked row, but I can't figure out how to get the correspondent column.id

<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="anyfunction(row.id)"></tr>
leocibu
  • 23
  • 3

1 Answers1

0

you need to set the (click) event in the <td> element instead of <tr>

Zerotwelve
  • 2,087
  • 1
  • 9
  • 24