[eluser]InsiteFX[/eluser]
If you look in the CodeIgniter Users Guide there is a Table Template that you can setup to do just that.
Code:
// Needs to be updated to the CI 2.2.0 version of Table Template.
/**
* __construct()
*
* Class Constuctor PHP 5+
*
* @access public
* @param string
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->library('table');
$this->load->database();
$this->load->helper('url');
$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);
}
You will need to create a CSS class for .alt tr assign your colors to them.