CodeIgniter Forums
Table - Custom Column Width? - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Table - Custom Column Width? (/thread-28416.html)

Table - Custom Column Width? - El Forum - 03-10-2010

i am using the table class and it is working fine for me, the only issue i have is that i am not sure how to set the width of different columns.

for example, i have a first name, last name, address column.
the table class just does its own thing as far as column width goes, i would like to be able to manually the first name column to a certain with, set last name to its own certain width, etc.

does anyone know if this is possible with CI?

Table - Custom Column Width? - El Forum - 07-19-2011

You can do so by edit the information you send to table->add_row function.

For example, instead of calling $
this->table->add_row('apple', 'orange')
call the following
$this->table->add_row(array('data'=>'apple', 'style'=>'width:100px', array('data'=>'orange'), 'style'=>'width:200px;');

Not sure this is the best way, but it works