Kotchasan

HtmlTable
in package

HTML table class

Tags
see
https://www.kotchasan.com/

Table of Contents

$caption  : string
$properties  : array<string|int, mixed>
$tbody  : array<string|int, mixed>
$tfoot  : array<string|int, mixed>
$thead  : array<string|int, mixed>
__construct()  : mixed
Constructor.
addCaption()  : mixed
Set the caption of the table.
addFooter()  : mixed
Add a footer row to the table (tfoot).
addHeader()  : mixed
Add a header row to the table (thead).
addRow()  : mixed
Add a data row to the table (tbody).
create()  : HtmlTable
Create a new HtmlTable object.
render()  : string
Render the table to HTML.

Properties

$caption

private string $caption

The caption of the table

$properties

private array<string|int, mixed> $properties

The properties of the table

$tbody

private array<string|int, mixed> $tbody

The rows of the table (tbody)

$tfoot

private array<string|int, mixed> $tfoot

The rows of the table (tfoot)

$thead

private array<string|int, mixed> $thead

The headers of the table (thead)

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $properties = [] ]) : mixed
Parameters
$properties : array<string|int, mixed> = []

The properties of the table

Return values
mixed

addCaption()

Set the caption of the table.

public addCaption(string $text) : mixed
Parameters
$text : string

The caption text

Return values
mixed

addFooter()

Add a footer row to the table (tfoot).

public addFooter(TableRow $row) : mixed
Parameters
$row : TableRow

The TableRow object representing the row

Return values
mixed

addHeader()

Add a header row to the table (thead).

public addHeader(array<string|int, mixed> $headers) : mixed
Parameters
$headers : array<string|int, mixed>

The header data for the row

Return values
mixed

addRow()

Add a data row to the table (tbody).

public addRow(array<string|int, mixed> $rows[, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$rows : array<string|int, mixed>

The data for the row

$attributes : array<string|int, mixed> = []

The attributes of the row

Return values
mixed

create()

Create a new HtmlTable object.

public static create([array<string|int, mixed> $properties = [] ]) : HtmlTable
Parameters
$properties : array<string|int, mixed> = []

The properties of the table

Return values
HtmlTable

The created HtmlTable object

render()

Render the table to HTML.

public render() : string
Return values
string

The HTML representation of the table

Search results