CodeIgniter Forums

Full Version: question to html table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]RcCluster[/eluser]
hi,

i like this class. but i also want to use <thead>, <tbody> and <tfoot>.

is this possible? i think the set_template function is not good for this.

thanks
RcCluster

El Forum

[eluser]TheFuzzy0ne[/eluser]
Just extend the library to suit your needs. CodeIgniter simply provides a foundation, it's up to you to build upon it.

El Forum

[eluser]RcCluster[/eluser]
[quote author="TheFuzzy0ne" date="1243361632"]Just extend the library to suit your needs. CodeIgniter simply provides a foundation, it's up to you to build upon it.[/quote]

thanks. i'm very new to ci so please be so kind and give me a little hint in how to extend the table library.

again thanks
RcCluster

El Forum

[eluser]Dam1an[/eluser]
There's a part in the user guide on extending core libraries (near the bottom)

Basically, you create you're extended class, and then overwrite the method you want to change (in this case the generate function I would assume) so copy that function accross and make whatever changes you want

El Forum

[eluser]Jazmo[/eluser]
Sorry i'm replying this old topic, but in case search gets you here, and you want just table header and table body, but no table footer, you can do this

Code:
$tmpl = array (
    'heading_row_start'   => '<thead><tr>',
    'heading_row_end'     => '</tr></thead><tbody>',
    'table_close'         => '</tbody></table>');

But maybe extending Table Library would be generally better idea. But then, on the other hand, if you need it just once..