8

To begin with my Code:

<!-- Edit Column -->
<ng-container mdColumnDef="edit">
  <md-header-cell *mdHeaderCellDef> {{'companies.edit-column' | translate}}</md-header-cell>
  <md-cell *mdCellDef="let element"><a (click)="toCompany(element.id)"><md-icon class="md-dark">edit</md-icon></a></md-cell>
</ng-container>

The Requirement is to adjust the position of the edit icon to the right (with respect of material design's right padding)? Right now it appears to be forcibly left-docked. Applying a style="{text-align: right}" to md-cell does not work.

version of libs:

"@angular/material": "2.0.0-beta.10"
"@angular/cdk": "^2.0.0-beta.10",
"@angular/common": "^4.1.3"
Vega
  • 27,856
  • 27
  • 95
  • 103
v.chjen
  • 615
  • 1
  • 8
  • 20
  • 1
    By any chance are you also using FlexLayout too? You can use the fxLayout directives here, positioning it with fxFlex shouldn't be a problem – Sonicd300 Sep 18 '17 at 15:24

1 Answers1

15

Use either of these:

mat-cell{
  display:flex !important;
  justify-content:flex-end!important;

}

::ng-deep .mat-cell{
  display:flex !important;
  justify-content:flex-end!important;
}

DEMO

Vega
  • 27,856
  • 27
  • 95
  • 103