tableCells( data[array], oddTrAttributes[array], evenTrAttributes[array],*-useCount[bool] )
data: Table data arranged as rows and columns in an array oddTrAttributes = null: HTML attributes to be passed to odd rows evenTrAttributes = null: HTML attributes to be passed to even rows useCount = false: If true, adds the class name column- plus the number of the row to the <tr> element
The $html->tableHeaders() function renders only the header row inside a table. Be sure to enter the <table> element tags by hand as HTML and include these table functions inside this element. The returned HTML contains both the <th> and <tr> tags, so to pass HTML attributes to one or both of these, use the trAttributes and thAttributes parameters, respectively. The following line:
<?=$html->tableHeaders(array('1','2'),array('class'=>'row'),array('class'=>^ 'header'));?>
will return the following:
<tr class="row"><th class="header">1</th> <th class="header">2</th></tr>
The names array for the $html->tableHeaders() function is formatted with only the names themselves without any nested arrays. However, the data array for the $html->tableCells() function must include nested arrays ordered by column for each row. For example, the following array is formatted for use in the $html->tableCells() function:
'column1','column2','column3'
'column1','column2','column3'
The actual text contained in the row keys (for example, row1 and row2) will not be displayed in the HTML output:
<td>column1</td> <td>column2</td> <td>column3</td> </tr> <tr>
<td>column1</td> <td>column2</td> <td>column3</td> </tr>
Post a comment