$this->table->set_heading() with row numbering? |
[eluser]veledrom[/eluser]
Hi, I'm using $this->table->set_heading('NAME', 'SURNAME'); How can I add numbering to rows? Thanks # NAME SURNAME 1 2 3 4
[eluser]Otemu[/eluser]
Hi, You could use the technique listed here Example of the technique: Code: SELECT emp_id, lname, fname, job_id, In your model you could add count and then just return the rownumber column in your view
[eluser]Otemu[/eluser]
[quote author="veledrom" date="1339071327"]I used this example. Did you find answer your thread yet? Thread[/quote] Am glad you asked this question as I was using a completely different technique which I knew was inadequate basically I was incrementing a number within my for loop and just outputting the number as a column, I was eventually going to look for a much more efficient way to do this, the methods above seem much better. No I haven't got a full answer to mu question yet, this is when your going to tell me you have the solution right :lol:
[eluser]CI_expert_indian[/eluser]
I am also using for loops for these type of task ...
[eluser]veledrom[/eluser]
I'll just put variable in query, of course with some security validations.
[eluser]veledrom[/eluser]
[quote author="deep_sheera" date="1339074475"] I am also using for loops for these type of task ...[/quote] So do I but can you add numbering to rows when using pagination and table library? If you can, show me what you've got.
[eluser]Learn CodeIgniter[/eluser]
Code: public function add_table_id()
[eluser]veledrom[/eluser]
Thanks. I'll keep this in mind if I need it in future because I decided write my own pagination library instead of using CIs. |
Welcome Guest, Not a member yet? Register Sign In |