Another difference between Web documents and printed documents is the application of headers and footers. Web document headers and footers are usually elaborate and appear only once in a Web document; conversely, headers and footers in printed documents are relatively simple and usually appear at the top and bottom of every page, typically to provide information such as page numbering or section headings.
Because of these differences, Highwire™ provides the following mechanisms to facilitate page headers and footers:
Use Highwire's <ctheader> tag to create a header for a Corda® image. This header appears in each page's top margin (i.e., between the top edge of the page and the top of the document content).
To add a header
Open the HTML document in an HTML or text editor, such as Notepad.
Locate the <head> tag for the document.
Insert the following code inside the <head> element:
<!--<ctheader><p align="center">This is my header.<br />Page %PAGENUM% of %PAGETOTAL%</p></ctheader>-->
Change the contents of the page header by changing the HTML code inside of the <ctheader> tag.
Note that %PAGENUM% and %PAGETOTAL% are special pre-defined variables that represent the current page number and the total number of pages, respectively. See Pre-defined Header and Footer Variables below for a list of other pre-defined variables.
Save the changes.
Specify the pages on which a header appears using the occurrence attribute of <ctheader>. For example, if you want a header to only appear on even-numbered pages, you can 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, and even.
Highwire supports multiple headers, each with different occurrence settings. For example, you can define one header that occurs on odd pages and another header that occurs on even pages.
Because the header is placed in the top margin of the page, that margin must be big enough to contain the header. If the margin isn't big enough and the header is cut off, you can change the page's top margin. For more information, see Document Margins.
Header margins control the position of the header within the page's top margin. Header margins do not affect the page margins. To change header margins, use the style attribute of <ctheader>, which supports the following styles: margin, margin-left, margin-right, and margin-top. For example, the following code defines a header with a margin of 2 inches on the sides:
<ctheader style="margin-left:2in;margin-right:2in">My Header</ctheader>
Change the margin size by replacing 2in with another size definition (such as 72pt). Size definitions require a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex. The default header margin is .25 in.
Use pre-defined Highwire variables, such as %h1%, to change the header content in the middle of the document (for example, if you want the header to reflect the title of the current section). The table below lists acceptable pre-defined header variables.
Pre-defined Header and Footer 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 document. Note: %PAGETOTAL% can only occur once per paragraph. It is recommended that %PAGETOTAL% be placed at the end of the paragraph. |
|
%PATH% |
Returns the location of the file that Highwire converts (URL or file path). |
|
%TIME% |
Returns the time on the Corda Server™ system clock when document conversion begins. This variable defaults to 12-hour format (AM and PM). |
|
%TIME12% |
Returns the time, in 12-hour format (AM and PM), on the Corda Server system clock when document conversion begins. |
|
%TIME24% |
Returns the time, in 24-hour format, on the Corda Server system clock when document conversion begins. |
|
%TITLE% |
Returns the contents of the HTML document <Title> tag |
You can also create custom variables. See Header and Footer Variables for more information.
Highwire's <ctfooter> tag creates a footer for the Corda image. This footer appears in each page's bottom margin (i.e., between the bottom edge of the page and the bottom of the document content).
To add a footer
Open the HTML document in an HTML or text editor, such as Notepad.
Locate the <head> tag for the document.
Insert the following code inside the <head> element:
<!--<ctfooter><p align="center">This is my footer.<br />Page %PAGENUM% of %PAGETOTAL%</p></ctfooter>-->
Change the contents of the page footer by changing the HTML code inside of the <ctfooter> tag.
Note that %PAGENUM% and %PAGETOTAL% are special pre-defined variables that represent the current page number and the total number of pages, respectively. See Pre-defined Header and Footer Variables above for a list of other pre-defined variables.
Save the changes.
Specify the pages on which a footer appears using the occurrence attribute of <ctfooter>. For example, if you want the footer to only appear on even-numbered pages, you can 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, and even.
Highwire supports multiple footers, each with different occurrence settings. For example, you can create one footer that occurs on odd pages and another footer that occurs on even pages.
Because the footer is placed in the bottom margin of the page, that margin must be big enough to contain the footer. If the margin isn't big enough and the footer is cut off, you can change the page's bottom margin. For more information, see Document Margins.
Footer margins control the position of the footer within the page's bottom margin. Footer margins do not affect the page margins. To change footer margins, use the style attribute of <ctfooter>, which supports the following styles: margin, margin-left, margin-right, and margin-top. For example, the code below creates a footer with a margin of 2 inches on the sides:
<ctfooter style="margin-left:2in;margin-right:2in">My Footer</ctfooter>
Change the margin size by replacing 2in with another size definition (such as 72pt). Size definitions require a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex. The default footer margin is .25in.
Use pre-defined Highwire variables, such as %h1%, to change the footer content in the middle of the document (for example, if you want the footer to reflect the title of the current section). The Pre-defined Header and Footer Variables table above lists acceptable pre-defined footer variables.
You can also create custom variables. See Header and Footer Variables for more information.
If you've used a browser to print a Web document with long tables in it, you've probably been frustrated by the inability to discern the heading of columns once the table breaks onto another page. Highwire can place table headers at the top of each successive table page, so you don't get lost in long tables.
To use this feature, you must indicate which rows are part of the table header by using the <th> tag for header cells instead of the <td> tag.
For example, consider the table below. There is nothing to tell Highwire that the top two rows are supposed to be table headers.
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>
However, if we make the following changes, Highwire recognizes that the top two rows are headers and repeats them at the top of each page in which the table appears.
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: Highwire supports multiple header rows in a table, but all header rows must appear before any normal rows.