title: serial number on the table in codeigniter pagination libarary
body: <p>I have problems when numbering the tables using CodeIgniter framework with libraary pagination. below are the table..</p>
  
  <pre><code>+------------------------------------------+
  | num| NIP    | Name   | Category  | Type  |
  +------------------------------------------+
  | 1  | 12345  | udin   | A         |  A1   |
  +------------------------------------------+
  |    |        |        | B         |  B1   |
  +------------------------------------------+
  |    |        |        | C         |  C1   |
  +------------------------------------------+
  | 2  | 54321  | JHON   | B         |  B2   |
  +------------------------------------------+
  |    |        |        | C         |  C1   |
  +------------------------------------------+
  </code></pre>
  
  <p>the issue is on the next page in the table below..</p>
  
  <pre><code>+------------------------------------------+
  | num| NIP    | Name   | Category  | Type  |
  +------------------------------------------+
  | 1  | 54321  | JHON   | F         |  F2   |
  +------------------------------------------+
  |    |        |        | G         |  G3   |
  +------------------------------------------+
  |    |        |        | G         |  G4   |
  +------------------------------------------+
  |    |        |        | I         |  I3   |
  +------------------------------------------+
  |    |        |        | J         |  J1   |
  +------------------------------------------+
  </code></pre>
  
  <p>I want the next page numbering sequential numbering starting from the end of the previous value. Supposedly in figure 2 numbering number "2" instead of "1".</p>
  
  <p>code in the controller: </p>
  
  <pre><code>$this-&gt;load-&gt;library('pagination');
  $data['judul'] = 'Report Data Attachment';
  $start_row = $this-&gt;uri-&gt;segment(3);
  $per_page = 10; 
  
          if (trim($this-&gt;uri-&gt;segment(3)) == '')
          {
              $start_row = '0';
          }
      $config['base_url'] = base_url().'report/index/';
      $config['total_rows'] = $this-&gt;lampiran_m-&gt;lampiran_karyawan_semua_page_conter()-&gt;num_rows();
      //$config['uri_segment'] = '3';
      $config['per_page'] = $per_page;
      $config['full_tag_open'] = '&lt;p class="page"&gt;';
      $config['full_tag_close'] = '&lt;/p&gt;';       
        $this-&gt;pagination-&gt;initialize($config);
      $data['pagination'] = $this-&gt;pagination-&gt;create_links();
       $data['lampiran'] = $this-&gt;lampiran_m-&gt;lampiran_karyawan_semua_page($start_row,','.$per_page);
  
  
  
          $data['no'] = '';
       $data['last'] = '';
  
       $this-&gt;template-&gt;display('tabel_report',$data);
  </code></pre>
  
  <p>and code in my Model :</p>
  
  <pre><code>public function lampiran_karyawan_semua_page($offset='',$limit='')
  {
      $qry = "select distinct lampiran.id_category,name_category,tipe,lampiran.nip from lampiran
      left join employee on (lampiran.nip = employee.nip)
      left join category on (lampiran.id_category=category.id_category) where lampiran.id_category = category.id_category and lampiran.nip=employee.nip  order by lampiran.nip desc limit $offset $limit";
      return $this-&gt;db-&gt;query($qry);
  }
  </code></pre>
  
  <p>and this code in view :</p>
  
  <pre><code>&lt;table border="1" width="100%" cellpadding="0" cellspacing="0" id="product-table" &gt;
              &lt;tr&gt;
              &lt;th class="table-header-repeat line-left minwidth-1"&gt; &lt;a href="#mainform"&gt;No&lt;/a&gt;&lt;/th&gt;
                  &lt;th class="table-header-repeat line-left minwidth-1"&gt; &lt;a href="#mainform"&gt;NIP&lt;/a&gt;&lt;/th&gt;
                  &lt;th class="table-header-repeat line-left minwidth-1"&gt; &lt;a href="#mainform"&gt;Name&lt;/a&gt;&lt;/th&gt;
                  &lt;th class="table-header-repeat line-left minwidth-1"&gt; &lt;a href="#mainform"&gt;Category Attachment&lt;/a&gt;&lt;/th&gt;
                  &lt;th class="table-header-repeat line-left minwidth-1"&gt;&lt;a href="#mainform"&gt;Type Attachment&lt;/a&gt;    &lt;/th&gt;
                  &lt;th class="table-header-repeat line-left minwidth-1"&gt;&lt;a href="#mainform"&gt;Page&lt;/a&gt;   &lt;/th&gt;
  
              &lt;/tr&gt;
              &lt;?php 
  
  
                      foreach($lampiran-&gt;result_array() as  $k) {
  
               $now=$k['nip'];
                if($last!=$now )  {
                  $no++;
                echo "&lt;tr&gt;&lt;td&gt;$no&lt;/td&gt;&lt;td&gt;$k[nip]&lt;/td&gt;&lt;td&gt;".$this-&gt;employee_m-&gt;get($k['nip'])-&gt;nama."&lt;/td&gt;&lt;td&gt;$k[name_category]&lt;/td&gt;&lt;td&gt;$k[tipe]&lt;/td&gt;&lt;td&gt;"; ?&gt;
                &lt;?php foreach($this-&gt;lampiran_m-&gt;conter_tabel_semua($k['id_category'],$k['tipe'],$k['nip'])-&gt;result() as $row) :?&gt;
                          &lt;?php echo $row-&gt;nilai;?&gt;
                      &lt;?php endforeach; 
                echo "&lt;/td&gt;&lt;/tr&gt;";
  
                }else{
  
                echo "&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;$k[name_category]&lt;/td&gt;&lt;td&gt;$k[tipe]&lt;/td&gt;&lt;td&gt;"; ?&gt;
                &lt;?php foreach($this-&gt;lampiran_m-&gt;conter_tabel_semua($k['id_category'],$k['tipe'],$k['nip'])-&gt;result() as $row) :?&gt;
                          &lt;?php echo $row-&gt;nilai;?&gt;
                      &lt;?php endforeach; 
                echo "&lt;/td&gt;&lt;/tr&gt;";
                }
               $last = $k['nip'];
  
               }
              ?&gt;
             &lt;tr&gt;&lt;td colspan="5" style="text-align: center;"&gt;&lt;b&gt;Jumlah Total&lt;/b&gt;&lt;/td&gt;&lt;td&gt;
                  &lt;?php foreach($this-&gt;lampiran_m-&gt;jumlah_semua_lampiran()-&gt;result() as $row) :?&gt;
                          &lt;?php echo "&lt;b&gt;$row-&gt;jumlah&lt;/b&gt;";?&gt;
                      &lt;?php endforeach; ?&gt;
             &lt;/td&gt;&lt;/tr&gt;
  
              &lt;/table&gt;
  </code></pre>
  
  <p>I hope someone can help me on this issue .. thanks</p>