PHP code example of donami / ctable

1. Go to this page and download the library: Download donami/ctable 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/ */

    

donami / ctable example snippets



$di->set('HTMLTable', 'donami\CTable\CTable');

$data = array(
  array('First', 'Second', 'Third'),
  array('Fourth', 'Fifth', 'Sixth')
);

echo $app->HTMLTable->generate($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();

$app->HTMLTable->defineTags(array('table_start' => '<table style="background: purple">'));