CI_Table::add_row()

add_row([$args = array()[, ...]])

Parameters:
  • $args (mixed) – An array or multiple strings containing the row values
Returns:

CI_Table instance (method chaining)

Return type:

CI_Table

Permits you to add a row to your table. You can submit an array or discrete params:

$this->table->add_row('Blue', 'Red', 'Green');

$this->table->add_row(array('Blue', 'Red', 'Green'));

If you would like to set an individual cell’s tag attributes, you can use an associative array for that cell. The associative key data defines the cell’s data. Any other key => val pairs are added as key=’val’ attributes to the tag:

$cell = array('data' => 'Blue', 'class' => 'highlight', 'colspan' => 2);
$this->table->add_row($cell, 'Red', 'Green');

// generates
// <td class='highlight' colspan='2'>Blue</td><td>Red</td><td>Green</td>
doc_CodeIgniter
2016-10-15 16:31:55
Comments
Leave a Comment

Please login to continue.