Another feature of the printed page that does not apply in quite the same manner to web documents is headers and footers. Whereas web document headers and footers are usually elaborate and appear only once in a web document, headers and footers in printed documents are relatively simple and usually appear at the top and bottom of every page—usually to provide navigational information such as page numbers or section headings.
Because of this, Highwire provides the following mechanisms to facilitate page headers and footers:
Document Headers
Using Highwire's <ctheader> tag, you can create a header for your Highwire document. This header will appear in the margin between the top edge of each page and the top of the page's content.
To add a header
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Locate the
<head>tag for your document. - Somewhere inside of the
<head>element, insert the following code: - Save your changes.
<!--<ctheader><p align="center">This is my header.<br />Page %PAGENUM% of %PAGETOTAL%</p></ctheader>-->
You can change the contents of the page header by changing the HTML code that appears inside of the<ctheader>element. This code can use any HTML tag except for<table>.
Note that%PAGENUM%and%PAGETOTAL%are special pre-defined variables that represent the page number and the total number of pages, respectively. See Table 3.1 for a list of other pre-defined variables.
Setting the Header Page Occurrence
You can specify which pages your header should appear on using the occurrence attribute of <ctheader>. For example, if you want the header only to appear on even-numbered pages, you would use the following tag:
<!--<ctheader occurrence="even"><p>This is an even page.</p></ctheader>-->
Acceptable values for the occurrence attribute include all, allbutfirst, odd, oddbutfirst, even.
You can even create multiple headers, each with different occurrence settings. For example, you could create one header that occurs on odd pages and another header that occurs on even pages.
Setting Header Margins
As stated before, the header is placed in the top margin of the page. This means that your page's top margin must be big enough to contain the header. If your header is being cut off, you need to change the page's top margin. See "Document Margins" for instructions.
You can also control the margins around the header itself. These margins do not affect the page margins, rather they affect the positioning of the header within the page's top margin. To do so, use the style attribute of <ctheader>. You can set any of the following styles in this attribute: margin, margin-left, margin-right, and margin-top. For example, the code below gives the header a margin of 2 inches on the sides:
<ctheader style="margin-left:2in;margin-right:2in">My Header</ctheader>
You could change the margin size by replacing 2in with another size definition (such as 72pt). Size definitions should include a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex. The default page margin is .25 inches.
Changing the Header in the Middle of a Document
You can use pre-defined Highwire variables, such as %h1%, to change parts of the footer in the middle of the document. the header in the middle of the document. This can be useful for when you want the header to reflect the title of the current section. Table 3.1 below lists acceptable pre-defined variables.
|
Variable
|
Purpose
|
|---|---|
![]() |
|
|
%DATE%
|
The current date, formatted as mm/dd/yyyy (e.g. 2/26/2004).
|
|
%DATE_MDY%
|
The current date, formatted as mm/dd/yyyy (e.g. 2/26/2004).
|
|
%DATE_DMY%
|
The current date, formatted as dd.mm.yyyy (e.g. 26.02.2004
|
|
%DATE_YMD%
|
The current date, formatted as yyyy-mm-dd (e.g. 2004-02-26).
|
|
%H1%
|
The contents of the most recent
<h1> tag.
|
|
%H2%
|
The contents of the most recent
<h2> tag.
|
|
%H3%
|
The contents of the most recent
<h3> tag.
|
|
%H4%
|
The contents of the most recent
<h4> tag.
|
|
%H5%
|
The contents of the most recent
<h5> tag.
|
|
%H6%
|
The contents of the most recent
<h6> tag.
|
|
%PAGENUM%
|
The current page number.
|
|
%PAGETOTAL%
|
The total number of pages in the document1
|
|
1Note that |
You can also create your own variables. See "Header and Footer Variables" for more information.
Document Footers
Using Highwire's <ctfooter> tag, you can create a footer for your Highwire document. This footer will appear in the margin between the top edge of each page and the top of the page's content.
To add a footer
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Locate the
<head>tag for your document. - Somewhere inside of the
<head>element, insert the following code: - Save your changes.
<!--<ctfooter><p align="center">This is my footer.<br />Page %PAGENUM% of %PAGETOTAL%</p></ctfooter>-->
You can change the contents of the page footer by changing the HTML code that appears inside of the<ctfooter>element. This code can use any HTML tag except for<table>.
Note that%PAGENUM%and%PAGETOTAL%are special pre-defined variables that represent the page number and the total number of pages, respectively. See Table 3.1 for a list of other pre-defined variables.
Setting the Footer Page Occurrence
You can specify which pages your footer should appear on using the occurrence attribute of <ctfooter>. For example, if you want the footer only to appear on even-numbered pages, you would use the following tag:
<!--<ctfooter occurrence="even"><p>This is an even page.</p></ctfooter>-->
Acceptable values for the occurrence attribute include all, allbutfirst, odd, oddbutfirst, even.
You can even create multiple footers, each with different occurrence settings. For example, you could create one footer that occurs on odd pages and another footer that occurs on even pages.
Setting Footer Margins
As stated before, the footer is placed in the bottom margin of the page. This means that your page's bottom margin must be big enough to contain the footer. If your footer is being cut off, you need to change the page's bottom margin. See "Document Margins" for instructions.
You can also control the margins around the footer itself. These margins do not affect the page margins, rather they affect the positioning of the footer within the page's bottom margin. To do so, set the style attribute of <ctfooter>. You can set any of the following styles in this attribute: margin, margin-left, margin-right, and margin-top. For example, the code below gives the footer a margin of 2 inches on the sides:
<ctfooter style="margin-left:2in;margin-right:2in">My Footer</ctfooter>
You could change the margin size by replacing 2in with another size definition (such as 72pt). Size definitions should include a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex. The default page margin is .25 inches.
Changing the Footer in the Middle of a Document
You can use pre-defined Highwire variables, such as %h1%, to change parts of the footer in the middle of the document. This can be useful for when you want the header to reflect the title of the current section. Table 3.1 in the previous section lists acceptable pre-defined variables.
You can also create your own variables. See "Header and Footer Variables" for more information.
Table Headers
If you've ever used your browser to print a web document with long tables in it, you've probably been frustrated by the inability to discern the meaning of the columns in the table once the table crossed over to another page. One of the more amazing features of Highwire is its abilities to place table headers at the top of each page a table continues on, so you don't get lost in long tables.
However, in order for this feature to work, you must indicate which rows are part of your table header. You can do this by using the <th> tag for header cells instead of the <td> tag.
For example, consider the table below:
Example 3.1 Example Table Without Headers
<table>
<tr>
<td align="center" rowspan="3">Flight Statistics</td>
</tr>
<tr>
<td> </td>
<td>Arrivals</td>
<td>Departures</td>
</tr>
<tr>
<td>Atlanta</td>
<td>25</td>
<td>9</td>
</tr>
<tr>
<td>Boston</td>
<td>41</td>
<td>17</td>
</tr>
...
</table>
As it currently stands, Highwire has no idea that the top two rows are supposed to be table headers. However, if we make the following changes to the table, Highwire will know that the top two rows are headers, and as such should be repeated at the top of each page in which the table appears.
Example 3.2 Example Table With Headers
<table>
<tr>
<th align="center" rowspan="3">Flight Statistics</th>
</tr>
<tr>
<th> </th>
<th>Arrivals</th>
<th>Departures</th>
</tr>
<tr>
<td>Atlanta</td>
<td>25</td>
<td>9</td>
</tr>
<tr>
<td>Boston</td>
<td>41</td>
<td>17</td>
</tr>
...
</table>
Note: You can have as many header rows as you want in a table, but header rows must appear at top of table, before any normal rows.

CORDA