From 26364b934dc8f7fa25f26e1f172d2a13dd826a15 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 28 Oct 2006 05:22:02 +0000 Subject: --- user_guide/libraries/table.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index abe1a2bf0..880017acf 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -198,6 +198,36 @@ $this->table->set_template($tmpl); $this->table->add_row('Blue', 'Red', 'Green'); $this->table->add_row(array('Blue', 'Red', 'Green')); + +

$this->table->make_columns()

+ +

This function takes a one-dimensional array as input and creates +a multi-dimensional array with a depth equal to the number of +columns desired. This allows a single array with many elements to be +displayed in a table that has a fixed column count. Consider this example:

+ + +$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
+
+$new_list = $this->table->make_columns($list, 3);
+
+$this->table->generate($new_list)
+
+// Generates a table with this prototype
+
+<table border="0" cellpadding="4" cellspacing="0">
+<tr>
+<td>one</td><td>two</td><td>three</td>
+</tr><tr>
+<td>four</td><td>five</td><td>six</td>
+</tr><tr>
+<td>seven</td><td>eight</td><td>nine</td>
+</tr><tr>
+<td>ten</td><td>eleven</td><td>twelve</td></tr>
+</table>
+ + +

$this->table->set_template()

Permits you to set your template. You can submit a full or partial template.

-- cgit v1.2.3-24-g4f1b