Display an incrementing number in each row when using table class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Display an incrementing number in each row when using table class (/showthread.php?tid=26139) |
Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]max123[/eluser] I want to display an incrementing number in each row by using table class eg: 1 column1 column2 2 column1 column2 3 column1 column2 4 column1 column2 how can i do that. I'm new, therefore explain little bit more thanx in advance Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]flaky[/eluser] when you are building the array for the table, just add the extra column with the number Code: $this->load->library('table'); Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]max123[/eluser] I forgot to mention that i'm taking data from the database table Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]flaky[/eluser] Then I wouldn't recommend using the table class, generate it yourself example Code: //in the view Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]max123[/eluser] Thanx. But I need a way to do that using codeigniter table class. Otherwise it is point less to use the table class. I have already used the table class. Any ways, thanx for your support Display an incrementing number in each row when using table class - El Forum - 01-07-2010 [eluser]flaky[/eluser] one other way you could do it, change function in the the model to this Code: $query = $this->db->get('mytable'); |