| Fully Qualified Name: | CodeIgniter\View\Table |
HTML Table Generating Class
Lets you create tables manually or from database result objects, or arrays.
| Name | Description | Defined By |
|---|---|---|
| __construct() | Set the template from the table config file if it exists | Table |
| addRow() | Add a table row | Table |
| clear() | Clears the table arrays. Useful if multiple tables are being generated | Table |
| generate() | Generate the table | Table |
| makeColumns() | 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. | Table |
| setCaption() | Add a table caption | Table |
| setEmpty() | Set "empty" cells | Table |
| setFooting() | Set the table footing | Table |
| setHeading() | Set the table heading | Table |
| setTemplate() | Set the template | Table |
Set the template from the table config file if it exists
| Parameter Name | Type | Description |
|---|---|---|
| $config | array | (default: |
Returns: void
Add a table row
Can be passed as an array or discreet params
Returns: \Table
Clears the table arrays. Useful if multiple tables are being generated
Returns: \Table
Generate the table
| Parameter Name | Type | Description |
|---|---|---|
| $tableData | mixed |
Returns: string
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.
| Parameter Name | Type | Description |
|---|---|---|
| $array | array | |
| $columnLimit | int |
Returns: array
Add a table caption
| Parameter Name | Type | Description |
|---|---|---|
| $caption | string |
Returns: \Table
Set "empty" cells
Can be passed as an array or discreet params
| Parameter Name | Type | Description |
|---|---|---|
| $value | mixed |
Returns: \Table
Set the table footing
Can be passed as an array or discreet params
Returns: \Table
Set the table heading
Can be passed as an array or discreet params
Returns: \Table
Set the template
| Parameter Name | Type | Description |
|---|---|---|
| $template | array |
Returns: bool