Welcome Guest, Not a member yet? Register   Sign In
how to modify HTML Table class
#1

[eluser]Unknown[/eluser]
Hi,

I am just starting out with CI 1.6.

I am trying to customize the output of the HTML Table class.

I would like to specify the widths of the columns.

I have the following code:
$this->load->library('table');
$tmpl = array ('table_open'=> '<table border="0" cellpadding="4" cellspacing="0" width="640" class="sortable">');
$this->table->set_template($tmpl);
$this->table->set_heading(array('awardee', 'Year', 'Amount', '<img src="images/common/av_symb.gif">'));
$data['content'] = $this->table->generate($rows);

Basically everything works and displays a simple table.

I need to be able to specify the widths of inidividual columns, how do I do this.

I tried making each element of the set_heading an array eg:
$this->table->set_heading(array(array('awardee','width=300')), 'Year', 'Amount', '<img src="images/common/av_symb.gif">'));

This did not work.

Can someone enlighten me ?

Thanks,

Will




Theme © iAndrew 2016 - Forum software by © MyBB