From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/libraries/table.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'user_guide/libraries/table.html') diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index a08f95032..eeb3b421f 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -130,11 +130,11 @@ echo $this->table->generate();

Changing the Look of Your Table

-

The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template +

The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype:

-$tmpl = array (
+$tmpl = array (
                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',

                    'heading_row_start'   => '<tr>',
@@ -159,14 +159,14 @@ $tmpl = array (
$this->table->set_template($tmpl);
-

Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each +

Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data.

-

You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. +

You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed:

-$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
+$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

$this->table->set_template($tmpl); @@ -176,7 +176,7 @@ $this->table->set_template($tmpl);

Function Reference

$this->table->generate()

-

Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

+

Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

$this->table->set_caption()

@@ -186,19 +186,19 @@ $this->table->set_template($tmpl);

$this->table->set_heading()

-

Permits you to set the table heading. You can submit an array or discrete params:

+

Permits you to set the table heading. You can submit an array or discrete params:

$this->table->set_heading('Name', 'Color', 'Size'); $this->table->set_heading(array('Name', 'Color', 'Size'));

$this->table->add_row()

-

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

+

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:

+

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');
@@ -211,8 +211,8 @@ $this->table->add_row($cell, 'Red', 'Green');

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:

+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');
@@ -241,7 +241,7 @@ $this->table->generate($new_list);

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

-$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
+$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

$this->table->set_template($tmpl); @@ -250,7 +250,7 @@ $this->table->set_template($tmpl);

$this->table->set_empty()

-

Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

+

Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

$this->table->set_empty("&nbsp;"); @@ -258,7 +258,7 @@ $this->table->set_empty("&nbsp;");

$this->table->clear()

-

Lets you clear the table heading and row data. If you need to show multiple tables with different data you should +

Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this function after each table has been generated to empty the previous table information. Example:

-- cgit v1.2.3-24-g4f1b