Proposal HTP04
Adding Support for Footnotes in HTML Tables

Stephen Ferg, Bureau of Labor Statistics
Contact Info
Revised: August 8, 2002

For the best results when printing this page, set your browser's font size to SMALLEST.

Introduction

It is common for statistical data tables to contain footnotes and footnote references. Such footnotes are not external to the tables; they are an integral part of them, like the table caption. This paper proposes adding features to the HTML language specification in order to support footnotes in tables. The proposed new features are:

Before plunging into the technical details of this paper, it may be helpful to take a quick look at the last section, Examples, and look at the HTML markup for the example tables.

Discussion

In an HTML table specification, immediately after the position where the TFOOT element may be placed, it will be possible to place an optional TNOTES element.

The TNOTES element will be a container that can contain multiple NOTE elements. A NOTE element can contain any normal HTML content.

A required attribute of a NOTE element will be a NOTEID attribute. The NOTEID attribute will work like the ID attribute in the current HTML specification, with the following exceptions.

  1. Its scope (i.e. namespace) will be local to the table in which it is declared, so that different tables can have notes with the same NOTEID without a name clash.
  2. Any alphanumeric characters may be used in a NOTEID, with the exception of single and double quotes and whitespace characters.
  3. A NOTEID may begin with any valid - unlike regular IDs, a NOTEID is not required to begin with an alphabetic character. Thus, the following are valid NOTEIDs: "NOTE", "1", "2", "3", "*", "**", "†" (which displays as †) "‡" (which displays as ‡) , "§" or "§" (which displays as §) and combinations of these characters, such as "††" (which displays as ††) and "§§" (which displays as §§).

A REFS element may appear in the contents of any cell in the table, or in the CAPTION element. The REFS tag is an empty element whose main purpose in life is to serve as a hook upon which to hang its NOTEIDS attribute, although it may also take OPEN, SEP, and CLOSE attributes that over-ride those specified at the table levely by the TREFS tag. The function of the NOTEIDS attribute is roughly comparable to the function of the HEADERS attribute. The NOTEIDS attribute will contain a list of one or more NOTEIDs. It is required that all of the NOTEIDs listed in NOTEIDS attributes in a table, refer to NOTEIDs defined in NOTE elements contained in the TNOTES element of the table.

This mechanism will be sufficient to specify footnotes and footnote references in tables. That leaves us with the question of how a screen-reader should handle footnotes and footnote references, and how a visual browser should display them.

Rendering Notes

Notes will be rendered in a "notes table" immediately after the data table. The notes table will be rendered with the same width as the data table, but as if the BORDER, CELLPADDING, and CELLSPACING attributes are set to "0".

  1. Each row of the notes table will contain two cells, one for note references and one for the note associated with that note reference. The reason for keeping the note text in a separate cell from the note reference is to allow the text of a long note to wrap independently of the note reference. A note that wraps will never wrap around and be displayed under a note reference -- it will always be indented to the right of the reference.
  2. All cells in the notes table will berendered as if their VALIGN setting is "TOP".
  3. Note references cells will be rendered as if their ALIGN setting is "CENTER".
  4. Note text cells will be rendered as if their ALIGN setting is "LEFT".
  5. In the cell for note references, each reference will be rendered followed immediately (no intervening whitespace) by " ". The purpose of " " is to provide a visual separator between the note reference and the note text. There must be no intervening whitespace, because that might allow the " " to wrap onto the next line.
  6. If the data table has any setting that prevents a bottom border from displaying (e.g. a BORDER setting of "0" or a FRAME setting of "VSIDES") then there will be no table border to provide a visible separator between the body of the table and the notes. In such cases, the notes table will be rendered as if it had a first row containing one cell that spanned two columns, and that cell contained an HR (horizontal rule) element. This will provide a horizontal rule to act as a visual separator between the data table and the notes table.

Rendering Note References - the TREFS element

Probably the most difficult part of note handling is the formatting of the note references. Styles of formatting note references are not at all standardized, and vary widely from organization to organization. Consequently, it is important to provide the maximum degree fof flexibility in specifying how note references are to be visually formatted.

In an HTML table specification, immediately before the position where the THEAD element may be placed, it will be possible to place an optional TREFS element. This element must be placed before the THEAD element because its specifications may affect how rows in the THEAD are displayed.

When a browser encounters a REFS tage, the contents of the NOTEIDS attribute should be rendered according to the specifications in the TREFS tag.

The TREFS element will take three attributes: OPEN, CLOSE, and SEP. The value for each of these attributes is an arbitrary text string, except that the string may not include the (single or double) quotation marks (because quotation marks are used in HTML as an attribute delimiter). The OPEN attribute specifies HTML coding that will be inserted before the list of NOTEIDs when presenting a NOTEIDS attribute. The CLOSE attribute specifies HTML coding that will be inserted after the list of NOTEIDs when presenting a NOTEIDS attribute. And the SEP, or separator, attribute specifies HTML coding that will be inserted between NOTEIDs in the list, if the NOTEIDS attribute contains more than one NOTEID.

Here are some example specifications. The first specification is the default.

OPEN SEP CLOSE EXAMPLE COMMENT
"<sup>" ", " "</sup>" "<sup>1, 2, 3</sup>" The list of references is displayed as superscripts. References are separated by a comma and a space.These are the default settings.
"<sup>" "," " </sup>" "<sup>1,2,3</sup>" Same as the previous example, except that references are separated only by a comma.
"\" " \" "" "\1 \2 \3" The list of references is preceded a backslash. References are separated by a space and backslash. There is no closing delimiter on the list of references.
"(" " " ")" "(1 2 3)" The list of references is enclosed in parentheses. References are separated by a space.

Behavior of Note References

A visual browser should turn note references into links that point to their associated notes. The browser should keep track of the sequential number of each table on the page. Links and anchor-point names should be constructed from a combination of the table number and the NOTEID. (For example, for note 3 in table 2, the browser might construct the name table2note3.) Clicking on a footnote reference would jump the user to the appropriate note. The user can read the note, then return to the previous location on the page by using the browser's BACK button.

Spoken Presentation of Note References

When a screen reader encounters a REFS tag, then for each NOTEID in the NOTEIDS attribute, the screen reader should read the phrase "Reference to note" (or the corresponding phrase in whatever language the screen reader is reading in) and the NOTEID. It may then read the contents of the note, or ask the user if he wishes to have the note read. If the user responds in the affirmative, the screen reader should read the contents of the NOTE. A screen reader may provide an option to turn off the reading of the footnote references for the convenience of users who find them distracting.


EXAMPLES

A table that would display this way

Ruritanian Mineral Production
Mineral Production 1, 2 1999 2000 2001*
Bauxite 5 9999 9999 9999
Copper 3 9999 9999 9999
Iron4 9999 9999 9999
Not including the province of Narnia, which was annexed in 2000. [Now lets add some additional text, just to show how a show how a long footnote wraps. Note that there is no space between one note and another, but spaces could be inserted by usin BR tags after the note text.]
Adjusted to the 1990 value of the Ruritanian dinar.
Excluding copper/iron deposits.
Including copper/iron deposits.
Data for this year is incomplete. Values are imputed from partial data.
Data for this year is incomplete. Values are estimated from first quarter data.

Could be coded this way:

<TABLE CELLPADDING="5" CELLSPACING="0" BORDER="1" WIDTH="70%">
<CAPTION>Ruritanian Mineral Production</CAPTION>

<TNOTES>
<NOTE NOTEID="1">Not including the province of Narnia, which was annexed in 2000.</NOTE>
<NOTE NOTEID="2">Adjusted to the 1990 value of the Ruritanian dinar.</NOTE>
<NOTE NOTEID="3">Excluding copper/iron deposits.</NOTE>
<NOTE NOTEID="4">Including copper/iron deposits.</NOTE>
<NOTE NOTEID="5">Data for this year is incomplete. Values are imputed from partial data.</NOTE>
<NOTE NOTEID="*">Data for this year is incomplete.
	          Values are estimated from first quarter data.</NOTE>
</TNOTES>

<TR>
<TH align="center" >Mineral Production <REFS NOTEIDS="1 2" />  </TH>
<TH align="center">1999</TH>
<TH align="center">2000</TH>
<TH align="center"  >2001 <REFS NOTEIDS="5" />  </TH>
</TR>

<TR align="right">
<TH align="left" >Bauxite </TH>
<TD><REFS NOTEIDS="1 2" />  9999</TD>
<TD>9999</TD>
<TD>9999</TD>
</TR>

<TR align="right">
<TH align="left">Copper   <REFS NOTEIDS="3" />  </TH>
<TD>9999</TD>
<TD>9999</TD>
<TD>9999</TD>
</TR>

<TR align="right">
<TH align="left">Iron   <REFS NOTEIDS="4" />  </TH>
<TD>9999</TD>
<TD>9999</TD>
<TD>9999</TD>
</TR>

</TABLE>

Changing the BORDER setting to "0" and changing the TREFS setting to

<TREFS OPEN=" \" SEP="\" CLOSE="" />

could change the appearance of the table to this.

Ruritanian Mineral Production
Mineral Production \1\2 1999 2000 2001 \*
Bauxite \5 9999 9999 9999
Copper \3 9999 9999 9999
Iron \4 9999 9999 9999

Not including the province of Narnia, which was annexed in 2000. [Now lets add some additional text, just to show how a show how a long footnote wraps. Note that there is no space between one note and another, but spaces could be inserted by usin BR tags after the note text.]
Adjusted to the 1990 value of the Ruritanian dinar.
Excluding copper/iron deposits.
Including copper/iron deposits.
Data for this year is incomplete. Values are imputed from partial data.
Data for this year is incomplete. Values are estimated from first quarter data.