PHP code example of dejurin / php-table-generate
1. Go to this page and download the library: Download dejurin/php-table-generate library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dejurin / php-table-generate example snippets
$table = new Dejurin\PHPTableGenerate();
$table->set_heading('Currency', 'Amount', 'Color');
$data = [
[
[
'data' => 'Dollar',
'td' => 'th',
'scope' => 'row',
'class' => 'style'
],
100,
'#85bb65',
],
];
echo $table->generate($data);
/*
<table border="0" cellpadding="4" cellspacing="0">
<thead>
<tr>
<th>Currency</th><th>Amount</th><th>Color</th></tr>
</thead>
<tbody>
<tr>
<th class="style" scope="row">Dollar</th><td>100</td><td>#85bb65</td></tr>
</tbody>
</table>
*/