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

Breadcrumb

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

function Table::renderRow

Renders table row.

Example:

| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |

1 call to Table::renderRow()
Table::render in vendor/symfony/console/Helper/Table.php
Renders table to output.

File

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

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null) : void {
    $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
    $columns = $this->getRowColumns($row);
    $last = \count($columns) - 1;
    foreach ($columns as $i => $column) {
        if ($firstCellFormat && 0 === $i) {
            $rowContent .= $this->renderCell($row, $column, $firstCellFormat);
        }
        else {
            $rowContent .= $this->renderCell($row, $column, $cellFormat);
        }
        $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
    }
    $this->output
        ->writeln($rowContent);
}

API Navigation

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