Lately I'm stucked in countless table generating work, so I create this little library to ease myself.
You want to generate a table, so you have some field names for the table header, and you have lots of data for the table body. We assume they are fields and data.
Now, you can generate the table by doing this:
-
Fetch the latest library
composer require lovelock/spt
-
Use it in your code.
...
echo new \Spt\Table($fields, $data);
Enjoy it.