DAISY—Structure Guidelines: Elements, Tables

DAISY—Structure Guidelines: Elements, Tables

Information Object

Tables

Definition

A table is an arrangement of data with two or more columns and one or more rows in which the information in the leftmost column relates specifically to the information in the other column or columns. The format of a table may vary depending on the project style. A table usually has column headings and may or may not have a title. Tables normally read across from left to right.

Markup

Tables are marked up using the <table> element in combination with the <caption>, <thead> (header), optional <tbody> (main body of table), <tr> (table row), <th> (cell containing header information), and <td> (cell containing table data) elements. The <tfoot> tag can be used to add footer information. In addition, <col> defines the alignment properties for cells in one or more columns and <colgroup> groups adjacent columns that are semantically related.

The <table> tags surround the entire table. Certain optional elements, if used, must follow in this sequence: <caption>, either <col> or <colgroup>, <thead>, and <tfoot>. Any or all of these elements may be used. The content of the table, in the tbody element, follows. In simple tables, <tr> marks each row of table data cells (<td>). In tables consisting of multiple sections, <tbody> marks each section and contains one or more rows (<tr>).

The <thead> and <tfoot> elements contain table header and footer information, respectively, in rows <tr> of cells (usually <th>). Each, if used, may be used only once, but applies to all sections (<tbody>) of the table. Browsers and playback devices can duplicate headers and footers when breaking a table across page boundaries, or present them statically when sections are rendered in a scrolling panel.

A long table spanning several pages of the print book should have separate <pagenum> values for each of the pages on which the table appears. A <prodnote> explaining that the table spans several pages should be added prior to the table.

Syntax

<table>...</table>

<caption>...</caption>

<col>...</col>

<colgroup>...</colgroup>

<thead>...</thead>

<tfoot>...</tfoot>

<tbody>...</tbody>

<tr>...</tr>

<th>...</th>

<td>…</td>

Example 1

A very simple table with no caption, footer, nor <tbody>:

<table border="1">

<thead>

<tr>

<th>Parent Company</th>

<th>Divested Business</th>

</tr>

</thead>

<tr>

<td>U.S. Sprint</td>

<td>Cellular phone</td>

</tr>

<tr>

<td>Union Pacific</td>

<td>Oil, gas</td>

</tr>

<tr>

<td>Viacom</td>

<td>Cable TV</td>

</tr>

</table>

This table would be rendered as:

Parent CompanyDivested Business

U.S. SprintCellular phone

Union PacificOil, gas

ViacomCable TV

Example 2

<table border="1">

<caption>This table contains both a header and a footer.</caption>

<thead>

<tr>

<th>Number</th>

<th>A</th>

<th>B</th>

<th>C</th>

</tr>

</thead>

<tfoot>

<tr>

<th>Footer Number</th>

<th>Footer A</th>

<th>Footer B</th>

<th>Footer C</th>

</tr>

</tfoot>

<tbody>

<tr>

<td>1</td>

<td>A1</td>

<td>B1</td>

<td>C1</td>

</tr>

<tr>

<td>2</td>

<td>A2</td>

<td>B 2</td>

<td>C2</td>

</tr>

<tr>

<td>3</td>

<td>A3</td>

<td>B3</td>

<td>C3</td>

</tr>

</tbody>

</table>

This table would be rendered as:

This table contains both a header and a footer.

NumberABC

Footer NumberFooter AFooter BFooter C

1A 1B 1C 1

2A 2B 2C 2

3A 3B 3C 3

Example 3

A table which spans three pages can be set up. Page numbers may not occur within a table.

<pagenum id="pg255" page="normal">255</pagenum>

<prodnote render="required">The following table spans pages 255 to 257. It is recorded in its entirety on page 255. Text.</prodnote>

<table border="1">

<caption>This table contains a header and a footer.</caption>

<thead>

...

</thead>

<tbody>

...

</tbody>

</table>

<pagenum id="pg256" page="normal">256</pagenum>

<prodnote render="required">Producer's Note: This page contains Table XXX, which has been produced on page 255.</prodnote>

<pagenum id="pg257" page="normal">257</pagenum>

<prodnote render="required">Producer's Note: This page contains Table XXX, which has been produced on page 255.</prodnote>

Tags: DAISY