This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Console/Tests/Helper
Fabien Potencier 22adfdf504 merged branch umpirsky/console-helper-table (PR #6368)
This PR was squashed before being merged into the master branch (closes #6368).

Discussion
----------

[2.3] [Console] TableHelper

When building a console application it may be useful to display tabular data.

`TableHelper` can display table header and rows, customizable alignment of columns, cell padding and colors.

Basic usage example:
```php
$table = $app->getHelperSet()->get('table');
$table
    ->setHeaders(array('ISBN', 'Title', 'Author'))
    ->setRows(array(
        array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
        array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
        array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
        array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
    ))
;
$table->render($output);
```
Output:
![table](https://f.cloud.github.com/assets/208957/14955/6fb4f500-46ca-11e2-8435-0f6b22f96e58.png)

If this PR gets merged I will submit doc PR as well.

I'm sure there is a plenty of room for improvements so any feedback is welcome.

Commits
-------

8de7813 [2.3] [Console] TableHelper
2013-04-07 16:24:42 +02:00
..
DialogHelperTest.php Fix bug where backspacing to an empty string and using the arrow keys would fail. Added test to prevent in future 2013-01-08 13:05:24 +01:00
FormatterHelperTest.php [CS Fix] Consistent coding-style of concatenation operator usage 2013-04-02 10:39:57 +01:00
ProgressHelperTest.php [Console] Progress helper enhancements 2013-03-23 08:10:00 +01:00
TableHelperTest.php [2.3] [Console] TableHelper 2013-04-07 16:24:41 +02:00