TableThe <table> element organizes
arbitrarily complex relationships of tabular information. This standard table
markup allows column or row spanning and table captions or descriptions. An
optional title allowed inside the table element provides a caption to describe
the table.
See simpletable for
a simplified table model that can be specialized to represent more regular
relationships of data.
The DITA table is based on the OASIS Exchange Table Model, augmented
with DITA attributes which enable it for specialization, conref, and other
DITA processing. In addition, the table includes a desc element,
which enables table description that is parallel with figure description.
In DITA tables, in place of the expanse attribute used by other DITA elements, the pgwide attribute is
used in order to conform with the OASIS Exchange Table Model. This attribute has a similar semantic
(1=page width; 0=resize to galley or column).
Note: The
scale attribute represents a stylistic markup property that is maintained
for now in tables for legacy purposes. External stylesheets should enable
less dependency on this attribute. You should use the scale attribute judiciously
in your topics.
[edit] Example
Source:
<table>
<tgroup cols="2">
<colspec colname="COLSPEC0" colwidth="121*"/>
<colspec colname="COLSPEC1" colwidth="76*"/>
<thead>
<row>
<entry colname="COLSPEC0" valign="top">Animal</entry>
<entry colname="COLSPEC1" valign="top">Gestation</entry>
</row>
</thead>
<tbody>
<row>
<entry>Elephant (African and Asian)</entry>
<entry>19-22 months</entry>
</row>
<row>
<entry>Giraffe</entry>
<entry>15 months</entry>
</row>
<row>
<entry>Rhinoceros</entry>
<entry>14-16 months</entry>
</row>
<row>
<entry>Hippopotamus</entry>
<entry>7 1/2 months</entry>
</row>
</tbody>
</tgroup>
</table>
Formatted output:
| Animal
| Gestation
|
| Elephant (African and Asian)
| 19-22 months
|
| Giraffe
| 15 months
|
| Rhinoceros
| 14-16 months
|
| Hippopotamus
| 7 1/2 months
|
[edit] Contains
| Doctype
| Content model
|
| ditabase, topic, task, reference, concept, glossary, map, bookmap
| (
( (title) (optional) then (desc) (optional) ) (optional) then (tgroup) (one or more) )
|
[edit] Contained by
| Doctype
| Parents
|
| ditabase
| p, note, lq, li, itemgroup, dd, draft-comment, abstract, body, section, example, conbody, prereq, context, info, tutorialinfo, stepxmp, choice, stepresult, result, postreq, refbody, refsyn, glossdef, pd
|
| topic
| p, note, lq, li, itemgroup, dd, draft-comment, abstract, body, section, example, pd
|
| task
| p, note, lq, li, itemgroup, dd, draft-comment, abstract, body, section, example, prereq, context, info, tutorialinfo, stepxmp, choice, stepresult, result, postreq, pd
|
| concept
| p, note, lq, li, itemgroup, dd, draft-comment, abstract, body, section, example, conbody, pd
|
| reference
| p, note, lq, li, itemgroup, dd, draft-comment, abstract, body, section, example, refbody, refsyn, pd
|
| map, bookmap
| p, note, lq, li, itemgroup, dd, draft-comment
|
[edit] Inheritance:
- topic/table
[edit] Attributes
| Name
| Description
| Data Type
| Default Value
| Required?
|
| frame
| Specifies which portion of a border should surround the element.
Allowable values are: top Draw a line before the element bottom Draw a line after the element topbot Draw a line both before and after the element all Draw a box around the element sides Draw a line at each side of the element none Don't draw any lines around this element -dita-use-conref-target See Using the -dita-use-conref-target value for more information.
Some DITA processors or output
formats may not be able to support all values.
| bottom | topbot | all | sides | none | -dita-use-conref-target)
| #IMPLIED
| No
|
| colsep
| Column separator. A value of 0 indicates no separators; 1 indicates
separators.
| NMTOKEN
| #IMPLIED
| No
|
| rowsep
| Row separator. A value of 0 indicates no separators; 1 indicates
separators.
| NMTOKEN
| #IMPLIED
| No
|
| pgwide
| Determines the horizontal placement of the element. Supported values
are 1 and 0, although these are not mandated by the DTD.
For PDF, the value "1"
places the element on the left page margin; "0" aligns the element
with the left margin of the current text line and takes indention into account.
For
XHTML, the table surrounds the table data. Either value sets the table width
to 100%.
| NMTOKEN
| #IMPLIED
| No
|
| rowheader
| This attribute specifies whether the content of the first column
in a table contains row headings. In the same way that a column header introduces
a table column, the row header introduces the table row. This attribute makes
tables whose first column contains row headings more readable on output. Allowable
values are: firstcol The first column contains the row headings. norowheader Indicates that no column contains row headings. This is the processing default. -dita-use-conref-target See Using the -dita-use-conref-target value for more information.
| norowheader| -dita-use-conref-target)
| #IMPLIED
| No
|
| scale
| Specifies a percentage, selected from an enumerated list, that is
used to resize fonts in relation to the normal text size. This
attribute is primarily useful for print-oriented display.
The scale
attribute provides an acknowledged style-based property directly on DITA elements.
For the table and fig elements, the intent of the property is to allow authors
to adjust font sizes on the content of the containing element, primarily for
print accomodation. An image in these contexts is to be scaled only by its
own direct scale property. If not specifically scaled, such an image is unchanged
by the scale property of its parent table or fig.
| 60 | 70 | 80 | 90 | 100 | 110 | 120 | 140 | 160 | 180 | 200
| -dita-use-conref-target)
| #IMPLIED
| No
|
| %univ-atts; (%select-atts;, %id-atts;, %localization-atts;)
| A set of related attributes, described at %univ-atts;
| parameter entity
| PE not
applicable
| Not applicable
|
| %global-atts; (xtrf, xtrc)
| A set of related attributes, described at %global-atts;
| parameter entity
| PE not
applicable
| Not applicable
|
| class, outputclass
| Common attributes described in Other common DITA attributes
|
|
|
|
TOC: Language Specification 1.1
Parent topic: Table elements
Next topic: tgroup
|
|