Welcome Guest, Not a member yet? Register   Sign In
Add columns to HTML Table Class
#3

[eluser]danilm[/eluser]
Thanks for your reply,

this is the way i create the table(controller):

$this->load->model('gestionmodel');
$this->data['results'] = $this->gestionmodel->listarpaquetes($config['per_page'],$this->uri->segment(3));
$this->load->library('table');
$tmpl = array (
'table_open' => '<table cellspacing="2" cellpadding="0" width="100%">',

'heading_row_start' => '<tr>',
'heading_row_end' => '</tr>',
'heading_cell_start' => '<th class=titulos_lista>',
'heading_cell_end' => '</th>',

'row_start' => '<tr class=par>',
'row_end' => '</tr>',
'cell_start' => '<td class=centrado>',
'cell_end' => '</td>',

'row_alt_start' => '<tr class=impar>',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td class=centrado>',
'cell_alt_end' => '</td>',

'table_close' => '</table>'
);

$this->table->set_template($tmpl);

$this->table->set_heading('ID', 'Titulo', 'Fecha Inicio', 'Fecha Fin','Fecha Auto Publicacion','Fecha Auto Despublicacion','Publicado','Editar');

$this->load->view('listado',$this->data);

And in my view:
&lt;?php echo $this->table->generate($results); ?&gt;

What you're saying is to add rows instead heading? and then generating? do the table generates all the results without using foreach?

thanks again


Messages In This Thread
Add columns to HTML Table Class - by El Forum - 07-22-2008, 06:17 AM
Add columns to HTML Table Class - by El Forum - 07-22-2008, 07:11 AM
Add columns to HTML Table Class - by El Forum - 07-22-2008, 07:21 AM
Add columns to HTML Table Class - by El Forum - 07-22-2008, 07:38 AM
Add columns to HTML Table Class - by El Forum - 07-22-2008, 07:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB