-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.1.7 |
I was playing with tables and rowspans and it seems broken when using multiple rowspans.
I tried the following code:
$table = new Table($output);
$table->setRows([
[new TableCell('1a', ['rowspan' => 4]), new TableCell('1a', ['rowspan' => 2]), '1', 'a'],
['1', 'a'],
[new TableCell('1a', ['rowspan' => 2]), '1', 'a'],
['1', 'a'],
]);
$table->render();
Which renders:
+----+----+---+---+
| 1a | 1a | 1 | a |
| | | 1 | a |
| | | | |
| | | | |
| 1a | 1 | a | |
| | 1 | a | |
+----+----+---+---+
I was expecting to have:
+----+----+---+---+
| 1a | 1a | 1 | a |
| | | 1 | a |
| | 1a | 1 | a |
| | | 1 | a |
+----+----+---+---+
If I write my table the other way around like this:
$table = new Table($output);
$table->setRows([
['1', 'a', new TableCell('1a', ['rowspan' => 2]), new TableCell('1a', ['rowspan' => 4])],
['1', 'a'],
['1', 'a', new TableCell('1a', ['rowspan' => 2])],
['1', 'a'],
]);
$table->render();
I have the following (which was expected):
+---+---+----+----+
| 1 | a | 1a | 1a |
| 1 | a | | |
| 1 | a | 1a | |
| 1 | a | | |
+---+---+----+----+