Portlet Factory, Version 6.1.2


 

Page automation example: adding spacer rows to a table

By changing only the template, you can add spacer rows anywhere in a table: before the header, between the header and the data, before or after each data row, and after the entire table. This example has far too many spacer rows. Notice that it uses a Construct Name Qualifier of ByName_PhoneNumber so that this construct will only apply to a container with the name PhoneNumber.

The important step for adding spacer rows before and after the data rows was to separate the RepeatElement from the DataContainer. In the basic template, the DataContainer element of the table construct was not specified, so it defaulted to the same XML node as the RepeatElement. In this example, we want to repeat more than just the data row, we want to repeat around a section that includes the data row and the spacer rows. This is accomplished by adding a <span> tag which acts as the repeat element, and adding the <tr> for the DataContainer within it.

Note: All of the containers are left empty. This is because this overrides only the table construct, and the system will continue to use the ColumnHeader and ColumnData constructs that are already defined in the template. The (rather hideous) result of this addition to the basic template is beside it.

<table name="TableByName_PhoneNumber">
<tr><td colspan="100">
--- spacer row above header ---
</td></tr>
<tr name="TableHeaderContainer"></tr>
<tr><td colspan="100">
--- spacer row below header ---
</td></tr>
<span name="RepeatElement">
<tr><td colspan="100">
--- spacer row above each data row ---
</td></tr>
<tr name="DataContainer"></tr>
<tr><td colspan="100">
--- spacer row below each data row ---
</td></tr>
</span> <!-- end Table.RepeatElement -->
<tr><td colspan="100">
--- spacer row below entire table ---
</td></tr>
</table> <!-- end Table construct -->

Parent topic: Page Automation HTML templates


Library | Support |