Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b911d15

Browse files
committed
minor #10392 Documented the setHeaderTitle() and setFooterTitle() methods (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #10392). Discussion ---------- Documented the setHeaderTitle() and setFooterTitle() methods Fixes #10294. Commits ------- e29c5b1 Documented the setHeaderTitle() and setFooterTitle() methods
2 parents 04cc519 + e29c5b1 commit b911d15

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

components/console/helpers/table.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
6992
By default the width of the columns is calculated automatically based on their
7093
contents. Use the :method:`Symfony\\Component\\Console\\Helper\\Table::setColumnWidths`
7194
method to set the column widths explicitly::

0 commit comments

Comments
 (0)