I am using this code
You can simply use the *ngIf directive to check if dataSource is not empty.
*ngIf
dataSource
0" #table [dataSource]="dataSource" matSort > tâche {{element.tache}} outil {{element.outil}} No records found
No records found