Skip to content
PHP Ecosystem
Explore

Table

API reference › Scaffold › Console › Table

final classPHPForge\Scaffold\Console\Table
Sourcesrc/Console/Table.php

Renders a plain-text table whose columns are as wide as their longest cell and separated by two spaces.

MethodDescriptionDefined by
render() staticReturns the header line, a dash separator as wide as the table, and one line per row.Table
public static function render(list<string> $headers, list<list<string>> $rows): list<string>

Returns the header line, a dash separator as wide as the table, and one line per row.

Parameters

ParameterTypeDescription
$headerslist<string>Column headers.
$rowslist<list<string>>Rows with one cell per header.

Returns

list<string>: Lines without trailing newlines or trailing spaces.