composer require norman-huth/markdown
Create this table:
| ID | Name |
|:---|:--------------|
| 1 | Administrator |
| 2 | User |
| 4 | Hugo |
use NormanHuth\Markdown\Table;
$table = new Table();
$table->addCell('ID');
$table->addCell('Name');
$table->addRow([1, 'John Doe']);
$table->addRow([2, 'Johanna Doe']);
echo $table->render();
use NormanHuth\Markdown\Table;
$table = new Table();
$table->addCell('ID');
$table->addCell('Name');
$table->addRows(
[
[1, 'John Doe'],
[2, 'Johanna Doe'],
]
);
echo $table->render();
use NormanHuth\Markdown\Table;
$table = new Table();
$table->addCell('ID');
$table->addCell('Name');
$table->addRows(\App\Models\User::all(['id', 'name']));
return $table->render();