title: Angular material table with sticky header
body: <p>I'm using angular7 with Angular material design templates. Currently, my result is as follows, 
  <a href="https://i.stack.imgur.com/G4W78.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G4W78.jpg" alt="enter image description here"></a></p>
  
  <p>But I want my result is as follows. Scrollbar under sticky header.</p>
  
  <p><a href="https://i.stack.imgur.com/WgjVh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WgjVh.jpg" alt="enter image description here"></a></p>
  
  <p>I put some demo code and <a href="https://stackblitz.com/edit/angular-8fuwbr" rel="nofollow noreferrer">live demo</a> as your reference.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="example-container mat-elevation-z8"&gt;
    &lt;table mat-table [dataSource]="dataSource"&gt;
  
      &lt;!-- Position Column --&gt;
      &lt;ng-container matColumnDef="position"&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt; No. &lt;/th&gt;
        &lt;td mat-cell *matCellDef="let element"&gt; {{element.position}} &lt;/td&gt;
      &lt;/ng-container&gt;
  
      &lt;!-- Name Column --&gt;
      &lt;ng-container matColumnDef="name"&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt; Name &lt;/th&gt;
        &lt;td mat-cell *matCellDef="let element"&gt; {{element.name}} &lt;/td&gt;
      &lt;/ng-container&gt;
  
      &lt;!-- Weight Column --&gt;
      &lt;ng-container matColumnDef="weight"&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt; Weight &lt;/th&gt;
        &lt;td mat-cell *matCellDef="let element"&gt; {{element.weight}} &lt;/td&gt;
      &lt;/ng-container&gt;
  
      &lt;!-- Symbol Column --&gt;
      &lt;ng-container matColumnDef="symbol"&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt; Symbol &lt;/th&gt;
        &lt;td mat-cell *matCellDef="let element"&gt; {{element.symbol}} &lt;/td&gt;
      &lt;/ng-container&gt;
  
      &lt;tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"&gt;&lt;/tr&gt;
      &lt;tr mat-row *matRowDef="let row; columns: displayedColumns;"&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>.example-container {
    height: 400px;
    overflow: auto;
  }
  
  table {
    width: 100%;
  }
  </code></pre>