ghostff/text-tables-generator

Generates a plain text table, which can be copied or writen into any text file

v1.0.0 2016-09-09 15:38 UTC

This package is auto-updated.

Last update: 2020-05-16 00:43:21 UTC


README

Generates a plain text table, which can be copied or writen into any text file, And in some cases rendered to a browser output

Build Status Latest Stable Version License Latest Stable Version Minimum PHP Version

#Installation
You can download the Latest release version as a standalone, alternatively you can use Composer

$ composer require ghostff/text-tables-generator

Or add:

{
    "require": {
        "ghostff/text-tables-generator": "^1.0"
    }
}

to your composer.json

Demo

$table = new TextTable(2, 2, 2);
$table->config(array('border' => true));
echo $table->put('1,1', 'row 1, col 2')->align('L')
           ->put('1,2', 'row 1, col 2')
           ->put('2,1', 'row 2, col 2')->align('L')
           ->put('2,2', 'row 2, col 2')
           ->render();

Outputs

+----------------+----------------+
|row 1, col 2    |  row 1, col 2  |
+----------------+----------------+
|row 2, col 2    |  row 2, col 2  |
+----------------+----------------+