Skip to content

Commit 2b89342

Browse files
crisbetommalerba
authored andcommitted
fix(table): incorrect padding and text alignment in rtl (#12280)
Fixes the tables not inverting their padding and text alignment in RTL. Fixes #12276.
1 parent e88271a commit 2b89342

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib/table/table.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ tr.mat-row, tr.mat-footer-row {
8383

8484
th.mat-header-cell {
8585
text-align: left;
86+
87+
[dir='rtl'] & {
88+
text-align: right;
89+
}
8690
}
8791

8892
th.mat-header-cell, td.mat-cell, td.mat-footer-cell {
@@ -95,8 +99,18 @@ th.mat-header-cell, td.mat-cell, td.mat-footer-cell {
9599
// elements like ripples or badges from throwing off the layout (see #11165).
96100
th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:first-of-type {
97101
padding-left: $mat-row-horizontal-padding;
102+
103+
[dir='rtl'] & {
104+
padding-left: 0;
105+
padding-right: $mat-row-horizontal-padding;
106+
}
98107
}
99108

100109
th.mat-header-cell:last-of-type, td.mat-cell:last-of-type, td.mat-footer-cell:last-of-type {
101110
padding-right: $mat-row-horizontal-padding;
111+
112+
[dir='rtl'] & {
113+
padding-right: 0;
114+
padding-left: $mat-row-horizontal-padding;
115+
}
102116
}

0 commit comments

Comments
 (0)