title: How to use Ngx-pagination on table in angular 7
body: <p>Hi I have a list like,</p>
  <blockquote>
  <p>[{…}, {…}, {…}]</p>
  <p>0: {name: &quot;Manu&quot;, age: &quot;21&quot;, hobbies: Array(4)}</p>
  <p>1: {name: &quot;Anu&quot;, age: &quot;20&quot;, hobbies: Array(3)}</p>
  <p>2: {name: &quot;nandu&quot;, age: &quot;22&quot;, hobbies: Array(5)}</p>
  </blockquote>
  <p>I need to show this on a table.So i am doing the code below</p>
  <pre><code>&lt;table id='studTable'&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th style=&quot;text-align: center&quot;&gt;Student Name &lt;/th&gt;
          &lt;th style=&quot;text-align: center&quot;&gt;Age&lt;/th&gt;
          &lt;th style=&quot;text-align: center&quot;&gt;Hobbies&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr *ngFor=&quot;let student of students | paginate: { itemsPerPage: 10, currentPage: p } ; let i = index&quot;&gt;
          &lt;td&gt;
              &lt;input matInput [(ngModel)]=&quot;students[i].name&quot; name=&quot;name{{i}}&quot;&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;input matInput type=&quot;text&quot; [(ngModel)]=&quot;students[i].age&quot; name=&quot;age{{i}}&quot;&gt;&lt;/td&gt; 
          &lt;td&gt;
              &lt;mat-select [(ngModel)]=&quot;students[i].hobbies&quot; name=&quot;hobbies{{i}}&quot; multiple&gt;
                  &lt;mat-option *ngFor=&quot;let hobbie of studHobbies&quot; [value]=&quot;hobbie.studHobbie&quot;&gt;
                      {{hobbie.studHobbie}}
                  &lt;/mat-option&gt;
              &lt;/mat-select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;pagination-controls (pageChange)=&quot;p = $event&quot;&gt;&lt;/pagination-controls&gt;
  </code></pre>
  <p>But When i doing this,I am getting a bug like ,</p>
  <p>The first row of table is showing when i am pressing next page on pagination.But the Number of Items to be shown is correct,ie if I have 5 Items to show ,then pagination control div will show 5 pages ,But first record is repeating in each pages.</p>
  <p>I took <a href="https://www.freakyjolly.com/angular-7-6-pagination-implement-local-or-server-pagination-in-3-steps/" rel="nofollow noreferrer">https://www.freakyjolly.com/angular-7-6-pagination-implement-local-or-server-pagination-in-3-steps/</a>  for a reference of pagination.</p>
  <p>And  <a href="https://stackoverflow.com/a/48293486/9493078">https://stackoverflow.com/a/48293486/9493078</a>  Also.</p>