{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/14044","labels_url":"https://api.github.com/repos/symfony/symfony/issues/14044/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/14044/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/14044/events","html_url":"https://github.com/symfony/symfony/pull/14044","id":64129966,"number":14044,"title":"[Console] [Helper] [Table] Columns styles","user":{"login":"MAXakaWIZARD","id":1138453,"avatar_url":"https://avatars.githubusercontent.com/u/1138453?v=3","gravatar_id":"","url":"https://api.github.com/users/MAXakaWIZARD","html_url":"https://github.com/MAXakaWIZARD","followers_url":"https://api.github.com/users/MAXakaWIZARD/followers","following_url":"https://api.github.com/users/MAXakaWIZARD/following{/other_user}","gists_url":"https://api.github.com/users/MAXakaWIZARD/gists{/gist_id}","starred_url":"https://api.github.com/users/MAXakaWIZARD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAXakaWIZARD/subscriptions","organizations_url":"https://api.github.com/users/MAXakaWIZARD/orgs","repos_url":"https://api.github.com/users/MAXakaWIZARD/repos","events_url":"https://api.github.com/users/MAXakaWIZARD/events{/privacy}","received_events_url":"https://api.github.com/users/MAXakaWIZARD/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Console","name":"Console","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-24T23:58:31Z","updated_at":"2015-04-07T13:00:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/14044","html_url":"https://github.com/symfony/symfony/pull/14044","diff_url":"https://github.com/symfony/symfony/pull/14044.diff","patch_url":"https://github.com/symfony/symfony/pull/14044.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | \r\n| License       | MIT\r\n| Doc PR        | \r\n\r\nThis PR introduces ability to set styles for individual columns in table. For example, we can apply STR_PAD_LEFT for the last column (useful for money, file size etc).\r\n\r\nCode:\r\n```php\r\nuse Symfony\\Component\\Finder\\Finder;\r\nuse Symfony\\Component\\Console\\Helper\\Table;\r\nuse Symfony\\Component\\Console\\Helper\\TableStyle;\r\n\r\n$table = new Table($output);\r\n$table->setHeaders(['#', 'Path', 'Size']);\r\n\r\n$style = new TableStyle();\r\n$style->setPadType(STR_PAD_LEFT);\r\n\r\n$table->setColumnStyle(2, $style);\r\n\r\n$finder = new Finder();\r\n$finder->files()->in(\"/path/to/dir\")->name('*.php')\r\n$counter = 0;\r\nforeach ($finder as $file) {\r\n    $counter++;\r\n    $table->addRow([$counter, $file->getRealPath(), number_format($file->getSize(), 0, '.', ' ')]);\r\n}\r\n\r\n$table->render();\r\n```\r\nOutput:\r\n```\r\n+---+---------------------+--------+\r\n| # | Path                |   Size |\r\n+---+---------------------+--------+\r\n| 1 | autoload.php        |    183 |\r\n| 2 | ApplicationTest.php | 47 794 |\r\n| 3 | CommandTest.php     | 14 965 |\r\n| 4 | ListCommandTest.php |  2 369 |\r\n+---+---------------------+--------+\r\n```\r\nI will add tests a bit later."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/90540000","html_url":"https://github.com/symfony/symfony/pull/14044#issuecomment-90540000","issue_url":"https://api.github.com/repos/symfony/symfony/issues/14044","id":90540000,"user":{"login":"MAXakaWIZARD","id":1138453,"avatar_url":"https://avatars.githubusercontent.com/u/1138453?v=3","gravatar_id":"","url":"https://api.github.com/users/MAXakaWIZARD","html_url":"https://github.com/MAXakaWIZARD","followers_url":"https://api.github.com/users/MAXakaWIZARD/followers","following_url":"https://api.github.com/users/MAXakaWIZARD/following{/other_user}","gists_url":"https://api.github.com/users/MAXakaWIZARD/gists{/gist_id}","starred_url":"https://api.github.com/users/MAXakaWIZARD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAXakaWIZARD/subscriptions","organizations_url":"https://api.github.com/users/MAXakaWIZARD/orgs","repos_url":"https://api.github.com/users/MAXakaWIZARD/repos","events_url":"https://api.github.com/users/MAXakaWIZARD/events{/privacy}","received_events_url":"https://api.github.com/users/MAXakaWIZARD/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T13:00:07Z","updated_at":"2015-04-07T13:00:07Z","body":"@fabpot Any chances to have this in 2.7?"}}