Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Table.php

function Table::setColumnMaxWidth

Sets the maximum width of a column.

Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while formatted strings are preserved.

Return value

$this

File

vendor/symfony/console/Helper/Table.php, line 164

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

public function setColumnMaxWidth(int $columnIndex, int $width) : static {
    if (!$this->output
        ->getFormatter() instanceof WrappableOutputFormatterInterface) {
        throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output
            ->getFormatter())));
    }
    $this->columnMaxWidths[$columnIndex] = $width;
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal