Skip to content

Commit 7ea6441

Browse files
committed
Updated rowspan example to be more logical to humans
1 parent ef3a7de commit 7ea6441

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

components/console/helpers/table.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ In a similar way you can span multiple rows::
212212
->setHeaders(array('ISBN', 'Title', 'Author'))
213213
->setRows(array(
214214
array(
215-
new TableCell("This ISBN is spanning\nmultiple rows", array('rowspan' => 2)),
216-
'A Tale of Two Cities',
217-
'Charles Dickens',
215+
'978-0521567817',
216+
'De Monarchia',
217+
new TableCell("Dante Alighieri\nspans multiple rows", array('rowspan' => 2)),
218218
),
219-
array('Divine Comedy', 'Dante Alighieri'),
219+
array('978-0804169127', 'Divine Comedy'),
220220
))
221221
;
222222
$table->render();
@@ -225,12 +225,12 @@ which results in:
225225

226226
.. code-block:: text
227227
228-
+-----------------------+----------------------+-----------------+
229-
| ISBN | Title | Author |
230-
+-----------------------+----------------------+-----------------+
231-
| This ISBN is spanning | A Tale of Two Cities | Charles Dickens |
232-
| multiple rows | Divine Comedy | Dante Alighieri |
233-
+-----------------------+----------------------+-----------------+
228+
+----------------+---------------+---------------------+
229+
| ISBN | Title | Author |
230+
+----------------+---------------+---------------------+
231+
| 978-0521567817 | De Monarchia | Dante Alighieri |
232+
| 978-0804169127 | Divine Comedy | spans multiple rows |
233+
+----------------+---------------+---------------------+
234234
235235
You can use the ``colspan`` and ``rowspan`` options at the same time which allows
236236
you to create any table layout you may wish.

0 commit comments

Comments
 (0)