Angular Material Table -Border Inside the Table

后端 未结 2 1621
小鲜肉
小鲜肉 2021-02-06 12:27

I am using Angular material table and I want to set border inside the table, Using CSS I was able to set border: Normal case [

2条回答
  •  无人及你
    2021-02-06 12:51

    Approach-2: Eventually, I figured out the solution, since material uses flex-layout we can use CSS align-self: stretch; /* Stretch 'auto'-sized items to fit the container */Result with align-self: stretch

    Here is the updated CSS

        `.example-container {
          display: flex;
          flex-direction: column;
    
          flex-basis: 300px;
        }
    
        .mat-table {
          overflow: auto;
          max-height: 500px;
        }
    
         .mat-column-name{
        border-right: 1px solid grey;
        align-self: stretch;
        text-align: center
    
    
        }
        .mat-column-position{
        border-right: 1px solid grey;
        align-self: stretch;
        text-align: center;
    
        }
        .mat-column-weight{
        border-right: 1px solid grey;
        align-self: stretch;
        text-align: center;
    
        } 
        .mat-column-symbol{
    
        text-align: center;
        align-self: stretch;
        }
       .mat-column-weight{
           align-self: stretch;
        } `
    

提交回复
热议问题