md-table - How to update the column width

后端 未结 18 2091
离开以前
离开以前 2020-12-04 10:58

I have started using the md-table for my project, and I want fixed column width. Currently all columns width are divided into equal size.

Where can I get the documen

18条回答
  •  有刺的猬
    2020-12-04 11:29

    Let's take an example. If your table has columns as follows:

    
      
         ID 
         {{row.sid}} 
      
    
     
      
         Name 
         {{row.name}} 
      
    

    As this contain two columns. then we can set the width of columns using

    .mat-column-{
        width: % !important;
    }
    

    for this example, we take

      .mat-column-id{
        width: 20% !important;      
      }
      .mat-column-name{
        width: 80% !important;
      }
    

提交回复
热议问题