Provides helpers to display a table.
- author Fabien Potencier
- author Саша Стаменковић
- author Abdellatif Ait boudad
- author Max Grigorian
- author Dany Maillard
| Methods |
| public __construct(Symfony |
public addRow(Symfony
|
public addRows(array $rows) : static
|
| public appendRow(Symfony Adds a row to the table, and re-renders the table.
|
| public getColumnStyle(int $columnIndex) : Symfony Gets the current style for a column. If style was not set, it returns the global table style. |
| public getStyle() : Symfony Gets the current table style. |
| public static getStyleDefinition(string $name) : Symfony Gets a style definition by name. |
| public render() : void Renders table to output. Example: +---------------+-----------------------+------------------+ | ISBN | Title | Author | +---------------+-----------------------+------------------+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri | | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | +---------------+-----------------------+------------------+ |
| public setColumnMaxWidth(int $columnIndex, int $width) : static Sets the maximum width of a column. Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while formatted strings are preserved.
|
| public setColumnStyle(int $columnIndex, Symfony Sets table column style.
|
| public setColumnWidth(int $columnIndex, int $width) : static Sets the minimum width of a column.
|
| public setColumnWidths(array $widths) : static Sets the minimum width of all columns.
|
public setFooterTitle(?string $title) : static
|
public setHeaders(array $headers) : static
|
public setHeaderTitle(?string $title) : static
|
public setHorizontal(bool $horizontal = true) : static
|
public setRow(string|int $column, array $row) : static
|
public setRows(array $rows) : static
|
| public setStyle(Symfony Sets table style.
|
| public static setStyleDefinition(string $name, Symfony Sets a style definition. |
public setVertical(bool $vertical = true) : static
|
| Constants |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| private Symfony |
| Properties |
| private array $columnMaxWidths = [] |
| private array $columnStyles = [] |
| private array $columnWidths = [] |
| private string $displayOrientation = 'default' |
| private array $effectiveColumnWidths = [] |
| private ?string $footerTitle = NULL |
| private array $headers = [] |
| private ?string $headerTitle = NULL |
| private int $numberOfColumns |
| private Symfony |
| private bool $rendered = false |
| private array $rows = [] |
| private Symfony |
| private static array $styles |
| Methods |
| private buildTableRows(array $rows) : Symfony |
| private calculateColumnsWidth(iterable $groups) : void Calculates columns widths. |
| private calculateNumberOfColumns(array $rows) : void Calculate number of columns for this table. |
| private calculateRowCount() : int |
| private cleanup() : void Called after rendering to cleanup cache data. |
| private copyRow(array $rows, int $line) : array |
| private fillCells(iterable $row) : iterable fill cells for a row that contains colspan > 1. |
| private fillNextRows(array $rows, int $line) : array fill rows that contains rowspan > 1.
|
| private getCellWidth(array $row, int $column) : int |
| private getColumnSeparatorWidth() : int |
| private getNumberOfColumns(array $row) : int Gets number of columns by row. |
| private getRowColumns(array $row) : array Gets list of columns for the given row. |
private static initStyles() : array
|
| private renderCell(array $row, int $column, string $cellFormat) : string Renders table cell with padding. |
| private renderColumnSeparator(int $type = 0self::BORDER_OUTSIDE) : string Renders vertical column separator. |
| private renderRow(array $row, string $cellFormat, ?string $firstCellFormat = NULL) : void Renders table row. Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | |
| private renderRowSeparator(int $type = 2self::SEPARATOR_MID, ?string $title = NULL, ?string $titleFormat = NULL) : void Renders horizontal header separator. Example: +-----+-----------+-------+ |
| private resolveStyle(Symfony |
| Properties |
| private static array $styles |
| Methods |
| public static getStyleDefinition(string $name) : Symfony Gets a style definition by name. |
private static initStyles() : array
|
| public static setStyleDefinition(string $name, Symfony Sets a style definition. |