Welcome Guest, Not a member yet? Register   Sign In
Codeigniter HTML Table Class, adding custom cell
#1

[eluser]Ficoder[/eluser]
Hi,
Here is the example code what i used:

application/controllers/site.php
Code:
<?php

class Site extends Controller {
    
    function index()
    {
        $this->load->library('pagination');
        $this->load->library('table');
        
        //$this->table->set_heading('Id', 'The Title', 'The Content');
        
        $config['base_url'] = 'http://localhost:8888/ci/index.php/site/index';
        $config['total_rows'] = $this->db->get('data')->num_rows();
        $config['per_page'] = 10;
        $config['num_links'] = 20;
        $config['full_tag_open'] = '<div id="pagination">';
        $config['full_tag_close'] = '</div>';
        
        $this->pagination->initialize($config);
        
        $data['records'] = $this->db->get('data', $config['per_page'], $this->uri->segment(3));
        
        $this->load->view('site_view', $data);
        
    }
    
}

application\views\site_view.php

Code:
<!DOCTYPE html>

&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;title&gt;untitled&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
     <div id="container">
        <h1>Super Pagination with CodeIgniter</h1>
        
        &lt;?php echo $this->table->generate($records); ?&gt;
        &lt;?php echo $this->pagination->create_links(); ?&gt;
     </div>
&lt;/body&gt;
&lt;/html&gt;

This works great! But... I wan't to add two custom cells to every row, so i can Delete or Modify every row from link. And of course every link has to contain SQL entry unique ID. But is it possible to add custom cells in this situation, or is my only way to throw "HTML Table class" to trash bin and write all "manually"?


Messages In This Thread
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 06:58 AM
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 07:40 AM
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 07:44 AM
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 07:57 AM
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 08:04 AM
Codeigniter HTML Table Class, adding custom cell - by El Forum - 03-03-2011, 09:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB