![]() |
adding class to html table row - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: adding class to html table row (/showthread.php?tid=53120) |
adding class to html table row - El Forum - 07-11-2012 [eluser]intsurfer[/eluser] Hi! I've changed the Table.php library to set class for rows. I googled how to do it, but i decided to make some changes in the library file. This is code from my project: Code: foreach($res as $item){ Code: <tbody> adding class to html table row - El Forum - 07-11-2012 [eluser]InsiteFX[/eluser] Why, you can create your own Table Template add the class right there. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); adding class to html table row - El Forum - 07-11-2012 [eluser]rip_pit[/eluser] i think the template will only permit to set odd and even classes but not to specify different custom classes for any row. if i remember I met the case few weeks ago and had to stop using table helper (no time to develop my own lib) anyhow it could be a good lib, try publish it in the lib directory in the wiki https://github.com/EllisLab/CodeIgniter/wiki/ adding class to html table row - El Forum - 07-11-2012 [eluser]intsurfer[/eluser] [quote author="InsiteFX" date="1342039620"]Why, you can create your own Table Template add the class right there. [code] 'heading_row_start' => '<tr>', 'row_alt_start' => '<tr class="alt">', [/quote] cause i can have 10-10000 with different classes. I use those classes for filtering with JQuery. Third record - <tr class="6_5">, the next - <tr class="16_1">, etc. adding class to html table row - El Forum - 07-11-2012 [eluser]intsurfer[/eluser] [quote author="rip_pit" date="1342044725"]i think the template will only permit to set odd and even classes but not to specify different custom classes for any row. if i remember I met the case few weeks ago and had to stop using table helper (no time to develop my own lib) anyhow it could be a good lib, try publish it in the lib directory in the wiki https://github.com/EllisLab/CodeIgniter/wiki/[/quote] Thanks for the link! ![]() |