0

I want to put a margin in one of the column name, I can easily do this in Chrome Inspect in element style. But I cannot get it to change in CSS/HTML.

I would like the NAME column margin to move to left, I have tried using nth-child, but it messes up the other columns margin as well.

<ng-container matColumnDef="name" >
        <th class="header-row" mat-header-cell *matHeaderCellDef mat-sort-header>NAME</th>
        <td class="entry-row" *matCellDef="let user"><md-avatar title="{{user.name}}" type="active"></md-avatar><p class="users__username">{{user.name}}</p></td>
</ng-container>

th.mat-header-cell:first-of-type, td.mat-cell:first-of-type {
        margin-left: -20px;
}

enter image description here

  • this is for regular tables, it doesn't apply to md-table –  Sep 16 '19 at 20:34
  • Sorry for the noise. This might have something for you: https://stackoverflow.com/questions/45159066/md-table-how-to-update-the-column-width/45159710 – g_bor Sep 16 '19 at 20:41

0 Answers0