Menu

## HtmlTable
in package

HtmlTable.php : 18

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

HtmlTable.php : 23
`private string $caption`

The caption of the table

#### $properties

HtmlTable.php : 28
`private array<string|int, mixed> $properties`

The properties of the table

#### $tbody

HtmlTable.php : 33
`private array<string|int, mixed> $tbody`

The rows of the table (tbody)

#### $tfoot

HtmlTable.php : 38
`private array<string|int, mixed> $tfoot`

The rows of the table (tfoot)

#### $thead

HtmlTable.php : 43
`private array<string|int, mixed> $thead`

The headers of the table (thead)

### Methods

#### __construct()

HtmlTable.php : 50

Constructor.

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

##### Parameters

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

  The properties of the table

##### Return values

mixed —

#### addCaption()

HtmlTable.php : 63

Set the caption of the table.

`public addCaption(string $text) : mixed`

##### Parameters

$text : string

  The caption text

##### Return values

mixed —

#### addFooter()

HtmlTable.php : 73

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()

HtmlTable.php : 83

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()

HtmlTable.php : 94

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()

HtmlTable.php : 110

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()

HtmlTable.php : 121

Render the table to HTML.

`public render() : string`

##### Return values

string —

The HTML representation of the table

## Search results