CNXML uses the industry standard CALS Table
Model for including tables into CNXML documents. When you first insert a table using Edit-in-Place, you will see a blue window similar to the one shown in Figure 1.
Using the Edit-in-Place interface, you can add a name and change how many rows or columns your table needs.
Be sure to set the correct dimensions before you start editing the entries of the table, as the Resize table button will reset the entries to their default values.
Once your table is correctly sized, you can start editing the entries of your table, as shown in Figure 2.
Provided below is a brief description of the CALS tags,
their attributes, and children (along with a helpful example). For a more
complete description of the CALS Table consult the CALS Table
Spec.
The table tag marks the beginning of a table.
It has an optional first child of name (as you can see in the Edit-in-Place interface) and must contain one or more
tgroup tags. The Edit-in-Place interface, however, only supports the utilization of one tgroup. The
table tag also has many attributes, to find out
more information consult the CALS Table
Spec.
The tgroup tag marks the beginning of a new
portion of a table. It has a
required attribute cols which is the number of
columns in the tgroup; as mentioned previously, this attribute can be set using the Edit-in-Place interface. Its children tags are
zero, one, or more colspec or
spanspec, zero or one thead or tfoot, and one tbody tag.
The colspec tag is an empty tag
that specificies the column of a table or entrytbl. The names and numbers
specified as attributes are used for referencing by other
tags.
The spanspec tag is an empty tag that
identifies a horizontal span of columns and associated
attributes that can subsequently be referenced by its
spanname for repeated use in entry or entrytbl in different rows.
The thead tag identifies the heading row of a tgroup or entrytbl. The thead
tag can have zero, one, or more colspec tags and one or more row.
The tbody tag identifies the body of a tgroup or entrytbl. The tbody
tag must have one or more row
tags.
The entrytbl tag takes the place of an entry, but fits into a single row of tbody in a tgroup. The content model is the
same as that of a tgroup except
that tfoot is ommitted and
entrytbl is self-excluding. Its children tags
are zero, one, or more colspec
or spanspec, zero or one
thead or tfoot, and one tbody tag.
The entry tag identifies an entry in a row. The entry tag
contains ASCII text and zero, one, or many cite, term, cnxn, link, code, emphasis, or media.
It might sound a little confusing but I think that the best
way to understand a table is to look at Example 1. For more information, consult the
CALS
Table Spec.
<thead>
<row>
<entry>Month</entry>
<entry>Flower</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center">January</entry>
<entry align="center">Carnation</entry>
</row>
<row>
<entry align="center">February</entry>
<entry align="center">Violet</entry>
</row>
<row>
<entry align="center">March</entry>
<entry align="center">Daffodil</entry>
</row>
<row>
<entry align="center">April</entry>
<entry align="center">Sweet Pea</entry>
</row>
<row>
<entry align="center">May</entry>
<entry align="center">Sunflower</entry>
</row>
<row>
<entry>June</entry>
<entry>Honeysuckle</entry>
</row>
<row>
<entry>July</entry>
<entry>Larkspur</entry>
</row>
<row>
<entry>August</entry>
<entry>Lily</entry>
</row>
<row>
<entry>September</entry>
<entry>Forget-Me-Not</entry>
</row>
<row>
<entry>October</entry>
<entry>Marigold</entry>
</row>
<row>
<entry>November</entry>
<entry>Chrysanthemum</entry>
</row>
<row>
<entry>December</entry>
<entry>Narcissus</entry>
</row>
</tbody>
This code will end up looking like this:
Table 1: Birth Flowers
| Month |
Flower |
| January |
Carnation |
| February |
Violet |
| March |
Daffodil |
| April |
Sweet Pea |
| May |
Sunflower |
| June |
Honeysuckle |
| July |
Larkspur |
| August |
Lily |
| September |
Forget-Me-Not |
| October |
Marigold |
| November |
Chrysanthemum |
| December |
Narcissus |
"The canonical how-to guide to using Connexions."