title: cdk Virtual Scrolling with HTML table
body: <p>I am very new to angular and  have been stuck on this problem for more than a day now. Using Angular 7 and angular/cdk ver 7.3.4. What I am trying to accomplish seems very simple. I have a good old HTML table with large number of rows. I want to display it on the screen with virtual scrolling enabled (using cdk-virtual-scroll-viewport). I followed this tutorial to accomplish this:</p>
  
  <p><a href="https://www.thecodecampus.de/blog/virtual-scrolling-in-angular-7/" rel="noreferrer">https://www.thecodecampus.de/blog/virtual-scrolling-in-angular-7/</a></p>
  
  <p>I see it working in stackblitz on their page but when I try it in my environment, there is nothing. No errors in the chrome debugger, but nothing on the screen either. The h1 element on the top shows up but not the table itself. It is completely ignored. What am I missing here.Is this the right approach to do it?</p>
  
  <p>Thanks for the help:</p>
  
  <p>here is my component mark up:</p>
  
  <pre><code>&lt;h1&gt;CRD component&lt;/h1&gt;
  
  &lt;cdk-virtual-scroll-viewport [itemSize]="20"&gt;
      &lt;table&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;td&gt;Name&lt;/td&gt;
            &lt;td&gt;ID&lt;/td&gt;
          &lt;/tr&gt;   
        &lt;/thead&gt;
        &lt;tbody&gt;
          &lt;tr *cdkVirtualFor="let row of tableData"&gt;
            &lt;td&gt;{{row.name}}&lt;/td&gt;
            &lt;td&gt;{{row.id}}&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/cdk-virtual-scroll-viewport&gt;
  </code></pre>
  
  <p>And here is component code:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  
  @Component({
    selector: 'app-crd',
    templateUrl: './crd.component.html',
    styleUrls: ['./crd.component.css']
  })
  export class CrdComponent implements OnInit {
    name = 'Angular';
  
    tableData = [];
  
    constructor() { }
  
    ngOnInit() {
      for (let i = 0; i &lt; 1000; i++) {
        this.tableData.push({
          name: 'Name ${i}',
          id: i
        });
      }
    }
  
  }
  </code></pre>
  
  <p>finally, I have the app module updated like so:</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { FormsModule } from '@angular/forms';
  import { HttpClientModule } from '@angular/common/http';
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
  import { ScrollingModule } from '@angular/cdk/scrolling';
  
  
      import { AppRoutingModule } from './app-routing.module';
      import { AppComponent } from './app.component';
      import { UnitListComponent } from './Unit/unit-list.component';
      import { CrdComponent } from './crd/crd.component';
  
      @NgModule({
        declarations: [
          AppComponent,
          UnitListComponent,
          CrdComponent
        ],
        imports: [
          BrowserModule,
          FormsModule,
          AppRoutingModule,
          HttpClientModule,
          BrowserAnimationsModule,
          ScrollingModule
        ],
        providers: [],
        bootstrap: [AppComponent]
      })
      export class AppModule { }
  </code></pre>