summaryrefslogtreecommitdiffstats
path: root/system/libraries/Table.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-25 01:16:17 +0200
committeradmin <devnull@localhost>2006-10-25 01:16:17 +0200
commit2bc13859b72ceb8400d37adbba52b8404995bf03 (patch)
treed8dbe120776f1564525adfef6bc1b30c5516a98f /system/libraries/Table.php
parent25701d75807a3fc8707c8afdb5d43062acfcf88e (diff)
Diffstat (limited to 'system/libraries/Table.php')
-rw-r--r--system/libraries/Table.php38
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'];
}