Closed
Description
Symfony version(s) affected: 5.3.3
Description
If headers row doesn't present in a Table, the setHeaderTitle
call doesn't work.
How to reproduce
(new Table($output))
->setHeaderTitle('Reproducer')
->setRows([
['Value', '123-456'],
['Some other value', '789-0'],
])
->render()
;
renders
+------------------+---------+
| Value | 123-456 |
| Some other value | 789-0 |
+------------------+---------+
But
(new Table($output))
->setHeaderTitle('Reproducer')
->setHeaders(['Key', 'Value'])
->setRows([
['Value', '123-456'],
['Some other value', '789-0'],
])
->render()
;
renders
+-------- Reproducer --------+
| Key | Value |
+------------------+---------+
| Value | 123-456 |
| Some other value | 789-0 |
+------------------+---------+