CodeIgniter Forums

Full Version: Add class to row with HTML Table Class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

 I see in the documentation that you can add class to cell items like this:

Code:
$cell = ['data' => 'Blue', 'class' => 'highlight', 'colspan' => 2];

$table->addRow($cell, 'Red', 'Green');

But can you add class to entire row? or is not possible?

Something like this:

Code:
$row = ['data' => [123,567,789], 'class' => 'row-class'];

$table->addRow($row);
If you look in the User Guide on the Table it has a Template that you configure for everything.

I use it to make bootstrap tables, I load it in the __constructor to make it available to all.
The template applys to all elements. I want some rows to have specific class, not all.

For example, having all row background color red, green or gray defined by status, etc.