8000 minor #20654 [Console] Add markdown format to Table (amenk) · symfony/symfony-docs@889849c · GitHub
[go: up one dir, main page]

Skip to content

Commit 889849c

Browse files
committed
minor #20654 [Console] Add markdown format to Table (amenk)
This PR was squashed before being merged into the 7.3 branch. Discussion ---------- [Console] Add markdown format to Table Closes #20653 Commits ------- 2f95737 [Console] Add markdown format to Table
2 parents 8619cd8 + 2f95737 commit 889849c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

components/console/helpers/table.rst

+18-2
Original fi 8000 le line numberDiff line numberDiff line change
@@ -181,11 +181,27 @@ The table style can be changed to any built-in styles via
181181
// same as calling nothing
182182
$table->setStyle('default');
183183

184-
// changes the default style to compact
184+
// changes the default style to markdown
185+
$table->setStyle('markdown');
186+
$table->render();
187+
188+
This outputs the table in the Markdown format:
189+
190+
.. code-block:: terminal
191+
192+
| ISBN | Title | Author |
193+
|---------------|--------------------------|------------------|
194+
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
195+
| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
196+
| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
197+
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
198+
199+
You can also set the style to ``compact``::
200+
185201
$table->setStyle('compact');
186202
$table->render();
187203

188-
This code results in:
204+
The output of this command will be:
189205

190206
.. code-block:: terminal
191207

0 commit comments

Comments
 (0)
0