CodeIgniter Forums

Full Version: Table class - add XHTML attributes to add_row()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

CI noob here. Is there any way to add attributes to the table elements, for example:

                form_checkbox('checkbox_'.$user->id, $user->id),
                date('Y-m-d', strtotime($user->last_login)),
                date('Y-m-d', strtotime($user->created))

I need to add styling to some or all of the cells, for example:

<td class="checkbox-cell-style">&lt;input type="checkbox" name="checkbox_1" value="1" /&gt;&lt;/td><td>Display_Name</td>...

Is there any way to do this?

El Forum

Try reading - "Changing the Look of Your Table" is the section you want specifically, "Set_template" should also be checked into.

After those I would look for a pre-existing Table class extension (perhaps in the Wiki, or do a google search) or jump into writing your own class extension.

El Forum

I think I would probably just pass some data into a view, and grab the returned data. It's much more powerful, and just as simple. I think the table class was designed with simple tables in mind.