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

[eluser]ripken204[/eluser]
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?
#2

[eluser]Unknown[/eluser]
You can do so by edit the information you send to table->add_row function.

For example, instead of calling $
Code:
this->table->add_row('apple', 'orange')
call the following
Code:
$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