title: how to paginate data without reloading page?
body: <p>I have learned pagination from the link
  <a href="https://stackoverflow.com/questions/43690758/how-to-set-condition-in-following-code-for-marking-current-page-in-pagination/43690913#43690913">How to set condition in following code for marking current page in pagination?</a></p>
  
  <p>using code</p>
  
  <pre><code>&lt;?php
      $id=3;  //  test value
      $page=20;   //  test value
  
      $li=array();    //  temporary array for convenience
      $template='&lt;li%s&gt;&lt;a href="?id=%s"&gt;%s&lt;/a&gt;&lt;/li&gt;';
      if($id&gt;1) $li[]=sprintf($template,'',$id-1,'Previous');
      for($i=1;$i&lt;=$page;$i++) {
          if($i==$id) $li[]=sprintf($template,' class="active"',$i,$i);   //  Current
          else $li[]=sprintf($template,'',$i,$i);
      }
      if($id&lt;$page) $li[]=sprintf($template,'',$id+1,'Next');
      $li=implode('',$li); // convert to string for printing
  ?&gt;
  &lt;ul class="pagination"&gt;
  &lt;?php print $li; ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>But it is showing data after reloading data? is there any way to make it show without reloading page? I am new to pagination - please help.</p>