You are here

private function Table::getCellWidth 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::getCellWidth()

Gets cell width.

Parameters

array $row:

int $column:

Return value

int

1 call to Table::getCellWidth()
Table::getColumnWidth in vendor/symfony/console/Helper/Table.php
Gets column width.

File

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

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function getCellWidth(array $row, $column) {
  if (isset($row[$column])) {
    $cell = $row[$column];
    $cellWidth = Helper::strlenWithoutDecoration($this->output
      ->getFormatter(), $cell);
    if ($cell instanceof TableCell && $cell
      ->getColspan() > 1) {

      // we assume that cell value will be across more than one column.
      $cellWidth = $cellWidth / $cell
        ->getColspan();
    }
    return $cellWidth;
  }
  return 0;
}