From 4a814a65f9fd399662d341b66ea9178ae9450dad Mon Sep 17 00:00:00 2001 From: sarah-eit Date: Wed, 3 Jan 2024 10:04:52 +0100 Subject: [PATCH] [Console] [components] add information about the addRows method - table.rst --- components/console/helpers/table.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/components/console/helpers/table.rst b/components/console/helpers/table.rst index e83ed352a3e..8d160689de7 100644 --- a/components/console/helpers/table.rst +++ b/components/console/helpers/table.rst @@ -432,3 +432,24 @@ This will display the following table in the terminal: | Love | | Symfony | +---------+ + +.. tip:: + + You can create multiple lines using the :method:`Symfony\\Component\\Console\\Helper\\Table::addRows` method:: + + // ... + $table->addRows([ + ['Hello', 'World'], + ['Love', 'Symfony'], + ]); + $table->render(); + // ... + + This will display: + + .. code-block:: terminal + + +-------+---------+ + | Hello | World | + | Love | Symfony | + +-------+---------+