Angular Material Table Cell Formatting

后端 未结 4 1391
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 14:04

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:57

    At our project at work we use a lot of mat-tables. I've never had luck making any kind of truly customized table by ngFor-ing over the . Almost every one of our tables is built by individually defining each for each column.

    
         Employee Code 
         {{ employee.code }} 
    
    
    
         Status 
         
              {{ employee.status?.description }} 
        
    
    
    
         Salary 
         {{ employee.salary | currency}} 
    
    

    The advantage of this is you can define each column with the styles you want, as well as add more property-specific options such as pipes and/or the elvis operator.

提交回复
热议问题