CodeIgniter Forums

Full Version: where is rowspan in table class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]mysterious[/eluser]
i have created a table using table class, can't find any function or way for row and colspan. Can anyone help me??

El Forum

[eluser]danmontgomery[/eluser]
There isn't one. The table class isn't designed to handle much more than the most basic of tables. You can't set attributes on a per-cell or a per-row basis.

El Forum

[eluser]mysterious[/eluser]
its not fair..in other words we should not use table class??

[quote author="noctrum" date="1274813519"]There isn't one. The table class isn't designed to handle much more than the most basic of tables. You can't set attributes on a per-cell or a per-row basis.[/quote]

El Forum

[eluser]danmontgomery[/eluser]
I didn't say that... I said it isn't designed to handle much more than basic tables. You can always extend it if it doesn't do something you need.

El Forum

[eluser]mysterious[/eluser]
in fact i dnt have any idea to how to extend this class. Can you guide me? BTW is not row and col spaning 'basic table tasks'?

[quote author="noctrum" date="1274839905"]I didn't say that... I said it isn't designed to handle much more than basic tables. You can always extend it if it doesn't do something you need.[/quote]

El Forum

El Forum

[eluser]Unknown[/eluser]
[quote author="mysterious" date="1274774854"]i have created a table using table class, can't find any function or way for row and colspan. Can anyone help me??[/quote]

I know this one is a bit old, but I found this topic via google and I know the answer, so I'm posting it here. Here's the solution for adding `colspan` and `rowspan` to the table without extending the library:

Code:
ee()->table->add_row(
    'first col',
    'second col',
    array('rowspan' => '2', 'data' => 'extra tall')
);
ee()->table->add_row(
    array('colspan' => '2', 'data' => 'extra wide')
);

The core CodeIgniter library supports either a string or an associative array for a value. If an associative array is provided all key/value pairs are translated to attribute/value pairs with the exception of an entry with the array key of 'data'. the value for the key 'data' is used as the content of the table cell.