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\HelperCode
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;
}