Ismail Vittal Ismail Vittal - 1 year ago 278
Javascript Question

Javascript Array Table Pagination

I want to achieve pagination (5 records per page) for this simple JavaScript array table having pagination controls.

So far I created a table with data:

Can anyone route me to any demo or reference ?

Answer Source

try to use jQuery.dataTables...which gives the pagination as well as sorting options include this

   <link href="css/demo_page.css" rel="stylesheet" id="stylesheet"/>
      <link href="css/demo_table.css" rel="stylesheet" />
     <script  src="js/jquery.dataTables.js"></script>

and create table as like yours in javascript and declare class name as "abc"

               var table = document.createElement('table');
              var tbody = document.createElement('tbody');

and call jquery display length will be the number of data to be displayed,

jQuery call:


        "iDisplayLength": 5,


for reference use see website

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download