Html_Data_Table

Represents a HTML table. This class allows you to build a table by sequentially adding headings, rows, data, etc, and then outputting to either HTML, and array or JSON.

For example, the full HTML for the table can then be obtained by calling the to_html() method. This makes it a much cleaner way of producing the HTML required for a table.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

$above  : mixed
$attributes  : mixed
$below  : mixed
$current_row  : mixed
$data  : mixed
$footer  : mixed
$header  : mixed
__construct()  : mixed
add_above()  : mixed
add_attribute()  : mixed
add_below()  : mixed
add_data()  : mixed
add_footer()  : mixed
add_header()  : mixed
get_data()  : mixed
new_row()  : mixed
reset()  : mixed
reset_data()  : mixed
set_data()  : mixed
to_array()  : mixed
to_html()  : mixed
to_json()  : mixed

Properties

Methods

add_above()

public add_above(mixed $above) : mixed
Parameters
$above : mixed
Tags
deprecated
1.3

No longer used.

Return values
mixed

add_attribute()

public add_attribute(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Return values
mixed

add_below()

public add_below(mixed $below) : mixed
Parameters
$below : mixed
Tags
deprecated
1.3

No longer used.

Return values
mixed

add_data()

public add_data(mixed $data[, mixed $attributes = false ][, mixed $key = false ]) : mixed
Parameters
$data : mixed
$attributes : mixed = false
$key : mixed = false
Return values
mixed
public add_footer(mixed $heading[, mixed $attributes = false ][, mixed $key = false ][, mixed $use_th = true ]) : mixed
Parameters
$heading : mixed
$attributes : mixed = false
$key : mixed = false
$use_th : mixed = true
Return values
mixed

add_header()

public add_header(mixed $heading[, mixed $attributes = false ][, mixed $key = false ][, mixed $use_th = true ]) : mixed
Parameters
$heading : mixed
$attributes : mixed = false
$key : mixed = false
$use_th : mixed = true
Return values
mixed

new_row()

public new_row([mixed $atts = false ]) : mixed
Parameters
$atts : mixed = false
Return values
mixed

set_data()

public set_data(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

to_array()

public to_array([mixed $data_only = false ]) : mixed
Parameters
$data_only : mixed = false
Return values
mixed

to_html()

public to_html([mixed $data_only = false ]) : mixed
Parameters
$data_only : mixed = false
Return values
mixed

to_json()

public to_json([mixed $data_only = false ]) : mixed
Parameters
$data_only : mixed = false
Return values
mixed

Search results