Skip to content

Commit 1fab386

Browse files
authored
fix(material/table): fixed layout not working (#32494)
Fixes that the `fixedLayout` input wasn't doint anything in the Material table, because: 1. The `cdk-table-fixed-layout` styles were being overridden by the Material table's styling. 2. The style that the Material table was applying didn't have any styles associated with it.
1 parent 29a8a2f commit 1fab386

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/material/table/table.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ $fallbacks: m3-table.get-tokens();
3030
background-color: token-utils.slot(table-background-color, $fallbacks);
3131
}
3232

33+
// These styles already come from a similar class in the CDK,
34+
// but the `.mat-mdc-table` styles override them.
35+
.mat-table-fixed-layout {
36+
table-layout: fixed;
37+
}
38+
3339
.mdc-data-table__cell {
3440
box-sizing: border-box;
3541
overflow: hidden;

src/material/table/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class MatRecycleRows {}
6666
styleUrl: 'table.css',
6767
host: {
6868
'class': 'mat-mdc-table mdc-data-table__table',
69-
'[class.mdc-table-fixed-layout]': 'fixedLayout',
69+
'[class.mat-table-fixed-layout]': 'fixedLayout',
7070
},
7171
providers: [
7272
{provide: CdkTable, useExisting: MatTable},

0 commit comments

Comments
 (0)