Welcome Guest, Not a member yet? Register   Sign In
Table - Custom Column Width?

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?

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

Theme © iAndrew 2016 - Forum software by © MyBB