HTML Table Class - add custom column to data selected from DB. Possible? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: HTML Table Class - add custom column to data selected from DB. Possible? (/showthread.php?tid=31275) |
HTML Table Class - add custom column to data selected from DB. Possible? - El Forum - 06-12-2010 [eluser]Unknown[/eluser] Hi, I'm currently working with the HTML Table Class and creating a table from a query. This is working well. I am attempting to add a 'custom' column to each row and don't know if this is possible. Basically the HTML table currently looks like this: Code: ID Field 1 Field 2 What I would like to add it a 4th column which will include a link which will link to another method using the ID as part of the URI. For example: Code: ID Field 1 Field 2 Custom? LINK1 would need to look something like this: http://example.com/class/method/ID. Is this possible with the HTML Table Class or will I have to write my own function to get the desired result. Many thanks in advance. HTML Table Class - add custom column to data selected from DB. Possible? - El Forum - 06-12-2010 [eluser]pickupman[/eluser] Try this: Code: $result = $query->result(); //save result from db query HTML Table Class - add custom column to data selected from DB. Possible? - El Forum - 06-13-2010 [eluser]Unknown[/eluser] Thanks for your advice pickupman - worked perfectly. |