You are here

private function Table::getColumnWidth in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/Table.php \Symfony\Component\Console\Helper\Table::getColumnWidth()

Gets column width.

Parameters

int $column:

Return value

int

2 calls to Table::getColumnWidth()
Table::renderCell in vendor/symfony/console/Helper/Table.php
Renders table cell with padding.
Table::renderRowSeparator in vendor/symfony/console/Helper/Table.php
Renders horizontal header separator.

File

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

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function getColumnWidth($column) {
  if (isset($this->columnWidths[$column])) {
    return $this->columnWidths[$column];
  }
  foreach (array_merge($this->headers, $this->rows) as $row) {
    if ($row instanceof TableSeparator) {
      continue;
    }
    $lengths[] = $this
      ->getCellWidth($row, $column);
  }
  return $this->columnWidths[$column] = max($lengths) + strlen($this->style
    ->getCellRowContentFormat()) - 2;
}