add css class to current row using HTML Table Class - 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: add css class to current row using HTML Table Class (/showthread.php?tid=22113) |
add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]kulldox[/eluser] I have the following piece of code: Code: $data = $this->pages->pages(); // List the pages What I want to do i to set a the .hidden css class to the row that has: Code: $key['status'] = '2' The way I did it here actually sets the classes for whole table but not the current row. How to do it for the current row using the HTML Table Class? Shure I know how to do it with out HTML Table Class add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]überfuzz[/eluser] Why do you have to put it out if it's going to be hidden? *Just curios* add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]kulldox[/eluser] [quote author="überfuzz" date="1251649104"]Why do you have to put it out if it's going to be hidden? *Just curios*[/quote] The reason for that is I want to apply a different style (lets say to make the text Grey) to the row that is hidden, so it differ from the rest. It's a show/hide function for front end pages add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]überfuzz[/eluser] Ok, in that case do you really have to make the array like that, if you just gonna alter it? How does the array look and where is it rendered? add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]kulldox[/eluser] #überfuzz, what do you mean "...do you really have to make the array like that, if you just gonna alter it?". The array is: Code: array(3) { But that's not important. In my opinion the $this->table->add_row() method should have the ability to pass additional parameter to the <tr> tag, like css, javascript or other stuff like that. I'll see, or all extend the Table Helper or I'll use raw html for this. add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]überfuzz[/eluser] Mhmm. I haven't used the function you're referring. I would fix it with a if-statement. The code below isn't fancy, but you'll definitively understand it. Code: if(!$data['active']) Hope you get my point, hope I've understand your issue. ;-) add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]kulldox[/eluser] [quote author="überfuzz" date="1251668523"]Mhmm. I haven't used the function you're referring. I would fix it with a if-statement. The code below isn't fancy, but you'll definitively understand it. Code: if(!$data['active']) Hope you get my point, hope I've understand your issue. ;-)[/quote] As I said previously, I know how to do it with raw HTML . My question is how to do it with the Table Helper. add css class to current row using HTML Table Class - El Forum - 08-30-2009 [eluser]InsiteFX[/eluser] Hi, It's a Library Class not a helper! All you need to do is extend the library with your own and add the functions / methods that you need. Enjoy InsiteFX add css class to current row using HTML Table Class - El Forum - 08-31-2009 [eluser]kulldox[/eluser] [quote author="InsiteFX" date="1251709591"]Hi, It's a Library Class not a helper! All you need to do is extend the library with your own and add the functions / methods that you need. Enjoy InsiteFX[/quote] Yep, you're right... not a helper [quote author="InsiteFX" date="1251709591"]Hi, ... extend the library with your own and add the functions / methods that you need. [/quote] Anyway, that's what I was thinking about too. |