Table
API reference › Scaffold › Console › Table
Renders a plain-text table whose columns are as wide as their longest cell and separated by two spaces.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
render() static | Returns the header line, a dash separator as wide as the table, and one line per row. | Table |
Method details
Section titled “Method details”render()
Section titled “render() ”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
| Parameter | Type | Description |
|---|---|---|
$headers | list<string> | Column headers. |
$rows | list<list<string>> | Rows with one cell per header. |
Returns
list<string>: Lines without trailing newlines or trailing spaces.