table class remove ID field when displaying the table - 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: table class remove ID field when displaying the table (/showthread.php?tid=40246) |
table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]R_Nelson[/eluser] i have a DB that stores my karaoke songs it has ID,SONG_NAME,ARTIST all i want to do for the moment is when i display it is remove the ID so all i have is song name and artist i'm amusing this can be done via a template from what i read about the table class how do i set up a template? table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]R_Nelson[/eluser] i have done quite a few searches on the net for this information and it looks like i would just have to make my table my self instead of using the table library table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]cahva[/eluser] If you want to view the table without and id, you can. Just select the fields you want and pass it to the table generate function: Code: $q = $this->db->select('SONG_NAME,ARTIST')->get('songs'); I myself havent used html table class in years. I prefer the freedom to define the table how I want(of course you can define it via templates in the table class but imho its easier to just pass the results to the view and modify the looks in that). table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]InsiteFX[/eluser] Hi R_Nelson First you wil need a MY_Controller makes it easier to use the the Table Class! MY_Controller - application/core/MY_Controller Code: class MY_Controller extends CI_Controller { Controller extended for the above MY_Controller Code: public function index() View Code: <!-- Generate the table in the view. --> Note: If you need to redo the table $this->table->clear(); InsiteFX table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]R_Nelson[/eluser] ok thats not what i was looking for i just dont want it to show the ID coloum! table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]InsiteFX[/eluser] If you do not want it to show just remove the $key['id'] InsiteFX table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]R_Nelson[/eluser] so just building the table manually is my best bet since i have no idea how to remove it using the table library? table class remove ID field when displaying the table - El Forum - 04-03-2011 [eluser]R_Nelson[/eluser] Quote:If you want to view the table without and id, you can. Just select the fields you want and pass it to the table generate function: lol this is what i get for only reading the last message i guess my question was already answered! i just missed it! |