diff options
Diffstat (limited to 'system/libraries/Table.php')
-rw-r--r-- | system/libraries/Table.php | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/system/libraries/Table.php b/system/libraries/Table.php index f3f9b32f6..da7bbbecf 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -28,10 +28,11 @@ */ class CI_Table { - var $rows = array(); - var $heading = array(); - var $template = NULL; - var $newline = "\n"; + var $rows = array(); + var $heading = array(); + var $template = NULL; + var $newline = "\n"; + var $empty_cells = ""; function CI_Table() @@ -78,6 +79,22 @@ class CI_Table { // -------------------------------------------------------------------- /** + * Set "empty" cells + * + * Can be passed as an array or discreet params + * + * @access public + * @param mixed + * @return void + */ + function set_empty($value) + { + $this->empty_cells = $value; + } + + // -------------------------------------------------------------------- + + /** * Add a table row * * Can be passed as an array or discreet params @@ -166,10 +183,19 @@ class CI_Table { $out .= $this->template['row_'.$alt.'start']; $out .= $this->newline; - foreach($row as $cells) + foreach($row as $cell) { $out .= $this->template['cell_'.$alt.'start']; - $out .= $cells; + + if ($cell == "") + { + $out .= $this->empty_cells; + } + else + { + $out .= $cell; + } + $out .= $this->template['cell_'.$alt.'end']; } |