Skip to content

Commit 360a984

Browse files
committed
Add box style table
1 parent c37b6be commit 360a984

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,18 @@ private static function initStyles()
635635
->setCellHeaderFormat('%s')
636636
;
637637

638+
$box = (new TableStyle())
639+
->setHorizontalBorderChar('')
640+
->setVerticalBorderChar('')
641+
->setCrossingChar('')
642+
;
643+
638644
return array(
639645
'default' => new TableStyle(),
640646
'borderless' => $borderless,
641647
'compact' => $compact,
642648
'symfony-style-guide' => $styleGuide,
649+
'box' => $box,
643650
);
644651
}
645652

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@ public function renderProvider()
136136
80-902734-1-6 And Then There Were None Agatha Christie
137137
=============== ========================== ==================
138138

139+
TABLE
140+
),
141+
array(
142+
array('ISBN', 'Title', 'Author'),
143+
$books,
144+
'box',
145+
<<<'TABLE'
146+
┼───────────────┼──────────────────────────┼──────────────────┼
147+
│ ISBN │ Title │ Author │
148+
┼───────────────┼──────────────────────────┼──────────────────┼
149+
│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
150+
│ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens │
151+
│ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien │
152+
│ 80-902734-1-6 │ And Then There Were None │ Agatha Christie │
153+
┼───────────────┼──────────────────────────┼──────────────────┼
154+
139155
TABLE
140156
),
141157
array(

0 commit comments

Comments
 (0)