• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Table class - add XHTML attributes to add_row()

#1
[eluser]Unknown[/eluser]
CI noob here. Is there any way to add attributes to the table elements, for example:

Code:
$this->table->add_row(
                form_checkbox('checkbox_'.$user->id, $user->id),
                $display_name,
                $user->role_name,
                $title,
                $user->last_ip,
                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:

Code:
<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?

#2
[eluser]brianw1975[/eluser]
Try reading http://ellislab.com/codeigniter/user-gui...table.html - "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.

#3
[eluser]TheFuzzy0ne[/eluser]
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.