-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Add box style table #25301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@maidmaid thanks for this contribution. And now the usual question for changes like this one: does this work perfectly on every operating system and terminal application? (We always have issues with Windows support). |
It supposed to work with DOS, according to the wiki page. Moreover, AppVeyor is green. But I didn't try on Windows. Maybe a Windows friend can give us a feedback? A friend like @ZHB maybe? ;) |
The test script (to use as-is, without my fork): <?php
require 'vendor/autoload.php';
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Output\ConsoleOutput;
(new Table(new ConsoleOutput()))
->setStyle((new TableStyle())
->setHorizontalBorderChar('─')
->setVerticalBorderChar('│')
->setCrossingChar('┼')
)
->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'),
))
->render()
; |
Thank you @maidmaid. |
This PR was merged into the 4.1-dev branch. Discussion ---------- [Console] Add box style table | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / > Box-drawing characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw various geometric frames and boxes. https://en.wikipedia.org/wiki/Box-drawing_character Box-drawing characters are done for the `TableStyle`; use them! Result:  Commits ------- 360a984 Add box style table
This PR was merged into the 4.1-dev branch. Discussion ---------- [Console] Make pretty the `box` style table | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / The console component is the 2nd most popular Symfony component with 70M of downloads. I think such composant has to provide faultless tables, with perfect management of borders, especially since the new `box` style table has been merged (cf symfony/symfony#25301).  Commits ------- 41f52b3a09 Make pretty the `box` style table
This PR was merged into the 4.1-dev branch. Discussion ---------- [Console] Make pretty the `box` style table | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / The console component is the 2nd most popular Symfony component with 70M of downloads. I think such composant has to provide faultless tables, with perfect management of borders, especially since the new `box` style table has been merged (cf #25301).  Commits ------- 41f52b3 Make pretty the `box` style table
Box-drawing characters are done for the
TableStyle
; use them!Result: