Angular Material Table Cell Formatting

后端 未结 4 598
刺人心
刺人心 2021-02-10 14:21

I\'m using angular material table for displaying data and dyanmically binding the table header and table data. Is there any way to format particaular column\'s cell content dyn

4条回答
  •  臣服心动
    2021-02-10 14:55

    Best solution is to use selector in css as below where 'column_name' is the name you provide in 'matColumnDef'

    .mat-column-'column_name'{
       //your custom css 
       text-align: right;
     }
    

    if your column 'matColumnDef' is 'amount'

    .mat-column-amount{
       //your custom css 
       text-align: right;
     }
    

提交回复
热议问题