CTable is a module for Anax used for creating HTML Tables in an easy manner.
Install CTable by using composer:
composer require donami/ctable
Use an array to create the table:
$di->set('HTMLTable', 'donami\CTable\CTable');
$data = array(
array('First', 'Second', 'Third'),
array('Fourth', 'Fifth', 'Sixth')
);
echo $app->HTMLTable->generate($data);
Will output:
<table>
<tr>
<td>First</td>
<td>Second</td>
<td>Third</td>
</tr>
<tr>
<td>Fourth</td>
<td>Fifth</td>
<td>Sixth</td>
</tr>
</table>
This is useful when looping through data
$di->set('HTMLTable', 'donami\CTable\CTable');
$app->HTMLTable->create_row(array('First', 'Second', 'Third'));
$app->HTMLTable->create_row(array('Fourth', 'Fifth', 'Sixth'));
echo $app->HTMLTable->generate();
Used for customizing the style of the table.
Example: Set the background of the table to purple
$app->HTMLTable->defineTags(array('table_start' => '<table style="background: purple">'));
Links: Packagist: https://packagist.org/packages/donami/ctable