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

Breadcrumb

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

function Table::getCellWidth

1 call to Table::getCellWidth()
Table::calculateColumnsWidth in vendor/symfony/console/Helper/Table.php
Calculates columns widths.

File

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

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function getCellWidth(array $row, int $column) : int {
    $cellWidth = 0;
    if (isset($row[$column])) {
        $cell = $row[$column];
        $cellWidth = Helper::width(Helper::removeDecoration($this->output
            ->getFormatter(), $cell));
    }
    $columnWidth = $this->columnWidths[$column] ?? 0;
    $cellWidth = max($cellWidth, $columnWidth);
    return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
}

API Navigation

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