PHP code example of snufkin / console-table

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

    

snufkin / console-table example snippets


$table = new \Console\Helper\ConsoleTable();
$table->setHeaders(['Column 1', 'Column 2']);
$table->addRow(['data 1', 'data 2']);
$table->addRow(['data 3', 'data 4']);
$table->addRow(['data 5', 'data 6']);
echo $table->getTable();

$table = new \Console\Helper\ConsoleTable(0);