Pagination in mf data table in angular 6

794 views Asked by At

I want to create pagination for mf datatable in serial number`1 to 10 continue on next page count from previous page.I have done this.

in ts

public rowsOnPage = 10;

in html

<table>
  <tr *ngFor="let data of mf.data; let i = index;">
        <td>{{i + 1}}</td>
        <td>{{data.name}}</td>
        <td>{{data.age}}</td>
   </tr>

  <mfBootstrapPaginator class="pagination-main f-right">  </mfBootstrapPaginator>
</table>
2

There are 2 answers

0
Shital On

Try this --

<table>
  <tr *ngFor="let data of mf.data; let i = index;">
        <td>{{data.indexOf(data) + 1}}</td>
        <td>{{data.name}}</td>
        <td>{{data.age}}</td>
   </tr>

  <mfBootstrapPaginator class="pagination-main f-right">  </mfBootstrapPaginator>
</table>
0
Yogesh Patil On
      <table>
  <tr *ngFor="let result of mf.result; let i = index+1;">
        <td>{{result.indexOf(data) + 1}}</td>
        <td>{{result.name}}</td>
   </tr>

  <mfBootstrapPaginator class="pagination-main f-right">  </mfBootstrapPaginator>
</table>