Search code examples
angularangular-materialmat-table

How to add border radius to angular mat table?


I am trying to make the mat-table border as round. But it is not working. Tried this-

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 1em;
}

How to achieve this?


Solution

  • the problem is that you need over-ride the background-color of mat-table:

    .mat-table
    {
      background-color:transparent!important;  
    }
    table {
      width: 100%;
      border-collapse: collapse;
      border-radius: 5em;
    }
    table tr:last-child td /*To remove the last border*/
    {
      border-bottom:0 solid
    }
    

    stackblitz