I'm working on an application in Angular 7 and Angular Material cdk 6. It's my first time with Angular Material. I have to override the css of my columns. None of my tries have worked.
* HTML *
<mat-menu #myMenu>
<ng-template myContentMenu>
<table mat-table>
<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef >Date</th>
<td mat-cell *matCellDef="let item" >{{ item.date }}</td>
</ng-container>
</table>
</ng-template>
I don't know how to put padding, I've tried encapsulation: ViewEncapsulation.None in the .ts file and :
* CSS *
:host { /** With and without host */
th.mat-column-date, td.mat-column-date {
padding-left: 20px; /** With and without !important */
}
::ng-deep mat-menu th.mat-column-date,
::ng-deep mat-menu td.mat-column-date {
padding-left: 20px !important;
}}
I don't know how to proceed. Does somebody have an idea ?
:hostdeclaration and add only our padding rules to your global style or to the style sheet which belongs to the component containing your table. Like -> stackblitz.com/edit/angular-pqd4qz The symbol column has a padding