Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] setColumnMaxWidth does not wrap header cells nicely #45520

Closed
@ondrejmirtes

Description

@ondrejmirtes

Symfony version(s) affected

5.4.3, 6.x possibly too

Description

I'd like setColumnMaxWidth to also wrap headers nicely. Currently it adds an extra border between the header lines.

This is how the output currently looks like:

------ ------------------------------------------------------------
  Line   src/Type/JustNullableTypeTrait.php (in context of class
 ------ ------------------------------------------------------------
         PHPStan\Type\StringType)
 ------ ------------------------------------------------------------
  81     Method PHPStan\Type\StringType::doFoo() has no return type
         specified.
 ------ ------------------------------------------------------------

This is how I'd like it to look like:

------ ------------------------------------------------------------
  Line   src/Type/JustNullableTypeTrait.php (in context of class
         PHPStan\Type\StringType)
 ------ ------------------------------------------------------------
  81     Method PHPStan\Type\StringType::doFoo() has no return type
         specified.
 ------ ------------------------------------------------------------

How to reproduce

In context of SymfonyStyle child class:

		$table = $this->createTable();
		$table->setHeaders($headers);
		$table->setRows($rows);
		$table->setColumnMaxWidth(1, 60);

		$table->render();

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions