\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.

Summary

Methods
Properties
Constants
__construct()
add_attribute()
add_header()
add_footer()
new_row()
add_data()
get_data()
set_data()
add_above()
add_below()
to_html()
to_array()
to_json()
reset()
reset_data()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$attributes
$header
$footer
$data
$current_row
$above
$below
N/A

Properties

$attributes

$attributes :

Type

$header

$header :

Type

$footer

$footer :

Type

$data

$data :

Type

$current_row

$current_row :

Type

$above

$above :

Type

$below

$below :

Type

Methods

__construct()

__construct()

add_attribute()

add_attribute(  $name,  $value)

Parameters

$name
$value

add_header()

add_header(  $heading,  $attributes = false,  $key = false,  $use_th = true)

Parameters

$heading
$attributes
$key
$use_th

add_footer()

add_footer(  $heading,  $attributes = false,  $key = false,  $use_th = true)

Parameters

$heading
$attributes
$key
$use_th

new_row()

new_row(  $atts = false)

Parameters

$atts

add_data()

add_data(  $data,  $attributes = false,  $key = false)

Parameters

$data
$attributes
$key

get_data()

get_data()

set_data()

set_data(  $data)

Parameters

$data

add_above()

add_above(  $above)

Parameters

$above

add_below()

add_below(  $below)

Parameters

$below

to_html()

to_html(  $data_only = false)

Parameters

$data_only

to_array()

to_array(  $data_only = false)

Parameters

$data_only

to_json()

to_json(  $data_only = false)

Parameters

$data_only

reset()

reset()

reset_data()

reset_data()