Table
» Stamp, alternative PHP Templates
This is a Painter plugin for Stamp. Usage:
echo Stamp_Painters_Table::paintTableFromArray(array(
array( 'Pizza','Price' ),
array( 'Margaretha','7.00'),
array( 'Funghi','8.00'),
array( 'Venezia','9.00')
))->wash();
echo Stamp_Painters_Table::paintTableWithHeaders(array(
array( 'Margaretha','7.00'),
array( 'Funghi','8.00'),
array( 'Venezia','9.00')
),array( 'Pizza','Price' ))->wash();
Template Details
<table>
<!-- cut:header -->
<thead>
<!-- cut:headrow -->
<tr>
<!-- cut:head -->
<th>#head#</th>
<!-- /cut:head -->
</tr>
<!-- /cut:headrow -->
<!-- paste:headrows -->
</thead>
<!-- /cut:header -->
<!-- paste:columns -->
<tbody>
<!-- cut:row -->
<tr>
<!-- cut:cell -->
<td>#cell#</td>
<!-- /cut:cell -->
<!-- paste:cells(cell,head) -->
</tr>
<!-- /cut:row -->
<!-- paste:rows(row) -->
</tbody>
</table>
Cut Points
| header | A table header |
| header headrow | One row for a table header |
| header headrow head | A cell for a row in table header |
| row | A normal row for table body |
| row cell | A cell in the row for a table body |
Glue Points
| header headrows | A place in the header to put header rows |
| columns | A place to put the table head |
| rows | A place to put table rows |
| row cells | A place in the row to put cells |
Slots
| headrow head | A place to put the column name (in headrow) |
| row cell cell | Cell slot |