In your controller, type this one:
$this->load->library('table');
$data = array(
array('Name', 'Gender', 'City'),
array('Lady Gaga', 'Female', 'New York City'),
array('Luna Maya', 'Female', 'Denpasar'),
array('Bill Clinton', 'Male', 'Virginia')
);
echo $this->table->generate($data);
Or you can generate the table from database. I like that, do this one:
$this->load->library('table');
$query = $this->db->query('SELECT * FROM user');
echo $this->table->generate($query);
No comments:
Post a Comment