$this->load->library('table');
$tmpl = array (
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
'thead_open' => '<thead>',
'thead_close' => '</thead>',
'heading_row_start' => '<tr>',
'heading_row_end' => '</tr>',
'heading_cell_start' => '<th>',
'heading_cell_end' => '</th>',
'tbody_open' => '<tbody>',
'tbody_close' => '</tbody>',
'row_start' => '<tr>',
'row_end' => '</tr>',
'cell_start' => '<td>',
'cell_end' => '</td>',
'row_alt_start' => '<tr class="alt">',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td>',
'cell_alt_end' => '</td>',
'table_close' => '</table>'
);
$this->table->set_template($tmpl);
Example table manage method change to suit yourself.
/**
* manage ()
* --------------------------------------------------------------------
*
* Description:
*
* @param string
*/
public function manage()
{
// Grab an array of users from the database
$data = $this->users->users();
// Set table headings
$this->table->set_heading('Username', 'Email', 'Actions');
foreach($data as $value => $key)
{
// Build the table actions links
$actions = anchor("admin/users/edit/".$key['id']."/", "Edit") .
anchor("admin/users/delete/".$key['id']."/", "Delete");
// Add row to table
$this->table->add_row($key['username'], $key['email'], $actions);
}
// Load the view
$this->load->view('users/manage');
}