\CI_Table

HTML Table Generating Class

Lets you create tables manually or from database result objects, or arrays.

Summary

Methods
Properties
Constants
__construct()
set_template()
set_heading()
make_columns()
set_empty()
add_row()
_prep_args()
set_caption()
generate()
clear()
_set_from_object()
_set_from_array()
_compile_template()
_default_template()
$rows
$heading
$auto_heading
$caption
$template
$newline
$empty_cells
$function
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$rows

$rows : 

Type

$heading

$heading : 

Type

$auto_heading

$auto_heading : 

Type

$caption

$caption : 

Type

$template

$template : 

Type

$newline

$newline : 

Type

$empty_cells

$empty_cells : 

Type

$function

$function : 

Type

Methods

__construct()

__construct() 

set_template()

set_template(  $template) : void

Set the template

Parameters

$template

set_heading()

set_heading() : void

Set the table heading

Can be passed as an array or discreet params

make_columns()

make_columns(  $array = array(),   $col_limit) : void

Set columns. Takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns. This allows a single array with many elements to be displayed in a table that has a fixed column count.

Parameters

$array
$col_limit

set_empty()

set_empty(  $value) : void

Set "empty" cells

Can be passed as an array or discreet params

Parameters

$value

add_row()

add_row() : void

Add a table row

Can be passed as an array or discreet params

_prep_args()

_prep_args(  $args) : \type

Prep Args

Ensures a standard associative array format for all cell data

Parameters

$args

Returns

\type

set_caption()

set_caption(  $caption) : void

Add a table caption

Parameters

$caption

generate()

generate(  $table_data = NULL) : string

Generate the table

Parameters

$table_data

Returns

string

clear()

clear() : void

Clears the table arrays. Useful if multiple tables are being generated

_set_from_object()

_set_from_object(  $query) : void

Set table data from a database result object

Parameters

$query

_set_from_array()

_set_from_array(  $data,   $set_heading = TRUE) : void

Set table data from an array

Parameters

$data
$set_heading

_compile_template()

_compile_template() : void

Compile Template

_default_template()

_default_template() : void

Default Template