File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
components/console/helpers Expand file tree Collapse file tree 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
6666 | 80-902734-1-6 | And Then There Were None | Agatha Christie |
6767 +---------------+--------------------------+------------------+
6868
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+
6992By default the width of the columns is calculated automatically based on their
7093contents. Use the :method: `Symfony\\ Component\\ Console\\ Helper\\ Table::setColumnWidths `
7194method to set the column widths explicitly::
You can’t perform that action at this time.
0 commit comments