8000 [Command] Table with rowspan display seems broken · Issue #21018 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Command] Table with rowspan display seems broken #21018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aledeg opened this issue Dec 22, 2016 · 0 comments
Closed

[Command] Table with rowspan display seems broken #21018

aledeg opened this issue Dec 22, 2016 · 0 comments

Comments

@aledeg
Copy link
aledeg commented Dec 22, 2016
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 |    |    |
+---+---+----+----+
fabpot added a commit that referenced this issue Feb 16, 2017
…. (aitboudad)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console][Table] fixed render when using multiple rowspans.

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21018
| License       | MIT
| Doc PR        | ~

Commits
-------

17e459e [Console][Table] fixed render when using multiple rowspans.
@fabpot fabpot closed this as completed Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0