CodeIgniter Forums
HTML table class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: HTML table class (/showthread.php?tid=73324)

Pages: 1 2


HTML table class - jdavidson - 04-11-2019

Does anyone know if the HTML table class will be supported in CI4? 

I did some searching and couldn't find it.


RE: HTML table class - ciadmin - 04-11-2019

You are right! It isn't in the list of ported components, and hasn't come up in any discussions that I can remember ... it fell through the cracks!! Is this something that should be in CI4?


RE: HTML table class - MGatner - 04-11-2019

I never used it! Is it as it sounds: takes an array and displays it as an HTML table? a la CLI::table()?


RE: HTML table class - dave friend - 04-11-2019

(04-11-2019, 01:04 PM)ciadmin Wrote: You are right! It isn't in the list of ported components, and hasn't come up in any discussions that I can remember ... it fell through the cracks!! Is this something that should be in CI4?

In my mind, it was discussed and explicitly excluded. But I wouldn't put money on that.

I have thought about porting it to C4 because the C3 library is a core component in a lot of backend code I regularly implement. I've been waiting for the C4 codebase to solidify before proceeding. Guess we're almost at that point.

I have also given a little thought to creating a version based on the Grid Layout CSS spec instead of <table> and its related HTML elements

Maybe we need a poll about this functionality?


RE: HTML table class - jdavidson - 04-19-2019

Just to throw my 2 cents in, I use it all the time for simple tables because its trivial to add the js DataTables class to the id and have a well formatted table without writing loops.

the one thing I do is extend it with a Library so I can send the column name along with the data, if you write custom functions for your tables it makes it very easy to do custom formatting. Usually I use this to convert the id column of a query to checkboxes for quick CRUD tables.

The table and calendar libraries are what brought me to CI initially, if its not included I know I can just extend it, but I think as a way to attract new and sometimes inexperienced users its great. Throwing a table up on screen out of a database is something people do millions of times a day.


RE: HTML table class - puschie - 04-24-2019

if you want to use it -> just copy the file to CI4, set correct namespace and have fun^^
maybe add a service entry to get global access

the class use nothing ci related so there should be no problems ( didnt test )

https://github.com/bcit-ci/CodeIgniter/blob/develop/system/libraries/Table.php


RE: HTML table class - dave friend - 04-24-2019

(04-24-2019, 06:08 AM)puschie Wrote: if you want to use it -> just copy the file to CI4, set correct namespace and have fun^^
maybe add a service entry to get global access

the class use nothing ci related so there should be no problems ( didnt test )

https://github.com/bcit-ci/CodeIgniter/blob/develop/system/libraries/Table.php

Actually, there is something. The generate method will accept either an array or an instance of CI_DB_result as an argument. So to allow the same kind of functionality will require some additional thought. I haven't done that thinking I've no idea if it will be trivial or it a can of worms. Smile

If no one else takes this up I will... eventually. (Please, feel free to beat me to it.)


RE: HTML table class - ciadmin - 04-24-2019

This could be something for 4.0.1


RE: HTML table class - puschie - 04-25-2019

sorry oversee it
-> here quick updated for ci4 https://pastebin.com/GyspEyeX


RE: HTML table class - ciadmin - 05-01-2019

Submitted https://github.com/codeigniter4/CodeIgniter4/pull/1978 with the CI4 implementation for this.