Professional > Interview scripting > Writing interview scripts > Page layout facilities > Templates > Grid templates > Levels in a grid template
 
Levels in a grid template
A grid template can contain formatting information at the following levels (shown in ascending order of precedence:
grid level
all cells
alternate rows
alternate columns
heading row (column headings)
heading column (row headings)
If the same tag appears at two or more levels in the template, the tag at the lower level overrides the same tag at the higher level for that particular aspect of the grid only. This allows you to define global characteristics for all cells in the grid and then to override certain of those characteristics for, say, the row headings. For example, you can have centered, bold, red text in all cells except the row headings which are left-aligned but still have bold, red text.
The grid and all-cells levels refer to the grid as a whole, and you'll normally define global specifications as relating to all cells rather than the grid itself. There are, however, some tags such as <name> and <colWidths> that cannot be defined at the all cells level and must be defined at the grid level. There are also some tags that mean different things when used at these levels. For example, <width> at grid level defines the width of the whole grid whereas at all-cells level it defines the widths of the individual columns.
To enter tags at the grid level, type them inside the <gridFormat> markers. To define global characteristics for all cells in the grid, place the appropriate tags within the following markers:
<allCells>...</allCells>
For example, to give all cells a pale green background, you can type:
<gridFormat>
<allCells>
<bgColor>
<colorFormat>numeric</colorFormat>
<color>#8FBC8F</color>
</bgColor>
</allCells>
</gridFormat>
In this particular instance, this has the same effect as typing:
<gridFormat>
  <bgColor>
    <colorFormat>numeric</colorFormat>
    <color>#8FBC8F</color>
  </bgColor>
</gridFormat>
The indentation makes the hierarchy of the example easy to follow, but it is not a requirement.
To define the characteristics of the heading row and heading column, enclose the appropriate tags in the following markers:
<headRow>...</headRow>
<headCol>...</headCol>
For more information, see Row and column headings.
To specify formatting for alternate rows and columns of the grid, place the necessary tags within the following markers:
<altBodyRow>...</altBodyRow>
<altBodyCol>...</altBodyCol>
For more information, see Different formats for alternate rows or columns.
See also
Grid templates