diff --git a/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts b/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts index f74152f7..75150fad 100644 --- a/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts +++ b/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts @@ -131,7 +131,8 @@ export abstract class AbstractTableComponent>((positionsByColumn, column) => { const textAlign = headerStyles?.[column.name]?.()?.[textAlignConst] - positionsByColumn[column.name] = textAlign === alignRightConst ? 'before' : 'after' + positionsByColumn[column.name] = + textAlign === alignRightConst || column.type === ColumnType.Number ? 'before' : 'after' return positionsByColumn }, {}) }) diff --git a/projects/ppwcode/ng-common-components/src/lib/table/table.component.scss b/projects/ppwcode/ng-common-components/src/lib/table/table.component.scss index fb48b91c..a61621af 100644 --- a/projects/ppwcode/ng-common-components/src/lib/table/table.component.scss +++ b/projects/ppwcode/ng-common-components/src/lib/table/table.component.scss @@ -1,14 +1,19 @@ @use '@angular/material' as mat; -:host ::ng-deep th[style*='text-align: right'] { - .mat-sort-header-container { - justify-content: end; - } -} +:host { + ::ng-deep { + th.ppw-column-type-number, + th[style*='text-align: right'] { + .mat-sort-header-container { + justify-content: end; + } + } -:host ::ng-deep th[style*='text-align: center'] { - .mat-sort-header-container { - justify-content: center; + th[style*='text-align: center'] { + .mat-sort-header-container { + justify-content: center; + } + } } } diff --git a/src/app/table/table-demo.component.ts b/src/app/table/table-demo.component.ts index ec523d2d..70802934 100644 --- a/src/app/table/table-demo.component.ts +++ b/src/app/table/table-demo.component.ts @@ -169,15 +169,6 @@ export default class TableDemoComponent rowIndex: () => { return { 'text-align': 'right' } }, - age: () => { - return { 'text-align': 'right' } - }, - income: () => { - return { 'text-align': 'right' } - }, - bonus: () => { - return { 'text-align': 'right' } - }, active: () => { return { 'text-align': 'center' } }