File tree 1 file changed +23
-0
lines changed
components/console/helpers 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,29 @@ You can add a table separator anywhere in the output by passing an instance of
66
66
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
67
67
+---------------+--------------------------+------------------+
68
68
69
+ You can optionally display titles at the top and the bottom of the table::
70
+
71
+ // ...
72
+ $table->setHeaderTitle('Books')
73
+ $table->setFooterTitle('Page 1/2')
74
+ $table->render();
75
+
76
+ .. code-block :: terminal
77
+
78
+ +---------------+----------- Books --------+------------------+
79
+ | ISBN | Title | Author |
80
+ +---------------+--------------------------+------------------+
81
+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
82
+ | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
83
+ +---------------+--------------------------+------------------+
84
+ | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
85
+ | 80-902734-1-6 | And Then There Were None | Agatha Christie |
86
+ +---------------+--------- Page 1/2 -------+------------------+
87
+
88
+ .. versionadded :: 4.2
89
+ The ``setHeaderTitle() `` and ``setFooterTitle() `` methods were introduced
90
+ in Symfony 4.2.
91
+
69
92
By default the width of the columns is calculated automatically based on their
70
93
contents. Use the :method: `Symfony\\ Component\\ Console\\ Helper\\ Table::setColumnWidths `
71
94
method to set the column widths explicitly::
You can’t perform that action at this time.
0 commit comments