HTML table class |
[eluser]Josssi[/eluser]
Hi people, did you ever create somebody table with for assistance of this class? Could you somebody to send me your table template and .css file for inspiration please? Thanks a lot ![]()
[eluser]InsiteFX[/eluser]
Can also be in your normal Controller. As far ass css you just style the fields the way you want and add the classes to the html tags below. Code: class MY_Controller extends CI_Controller {
[eluser]Josssi[/eluser]
thank you very much for reaction. And what for are good this rows bellow? <code> 'thead_open' => '<thead>', 'thead_close' => '</thead>', </code> and <code> 'tbody_open' => '<tbody>', 'tbody_close' => '</tbody>', </code> I didnt met this rows in guide and havent ever use something like that. What is function of it?
[eluser]Josssi[/eluser]
ok, i am sorry for my amateurs question, now i read something about thead and tbody ![]() ![]() <code> $this->table->set_template($tmpl); echo $this->table->generate($query); </code> I past your template into controller but my table looks everytime same. Whether i use them or not. I think that i make something wrong with sending applying tamplet on my data. Havent you got any other advice for me please?
[eluser]InsiteFX[/eluser]
You use $this->table->add_row(); to add data to the table, you can also add data using a foreach loop See the HTML Table Class below: CodeIgniter Users Guide - HTML Table Class
[eluser]Josssi[/eluser]
I read it all, but i am a litle bit mixed of them. I dont understant if I can use my own template if I want to generate dynamic table, where data are of database. I can get db-data, and i cat view them. Now if i use template which pasted you above, will i see changed my table? If yes, so I am doing something wrog :/.
[eluser]InsiteFX[/eluser]
You can call a method in your model and return a result_array() and loop through it to a to the table. Something like this: Code: // Grab an array of users from the database
[eluser]Josssi[/eluser]
Thank you for advice ![]() ![]() |
Welcome Guest, Not a member yet? Register Sign In |