Tei:table

From DM

Jump to: navigation, search


tei:table (table) "contains text displayed in tabular form, in rows and columns" (http://www.tei-c.org/P4X/ref-TABLE.html). The tei:table element contains rows made up of cells.

For a general discussion of how to encode tables in a variety of structural languages, see Table (part of the Category:How_do_I_encode... Binder). For a complete discussion of the tei element, see the relevant sections of the TEI P4 guidelines, http://www.tei-c.org/P4X/.

Tables never should be used in any structural language to position non-tabular material (e.g. multiple columns of text) on the page. Such layout can and should be handled by style sheets.

Contents

Subclasses and attributes

There are no required attributes or subclasses.

@type or @rend may be used to distinguish among different types of tables, e.g.

rend="wide"
rend="tall"
rend="border"

See the TEI Guidelines for a discussion of available attributes.

Style

Tables may be formatted a number of ways depending on their nature and type:

  • With or without border lines.
  • With cells, rows, or columns of different background colors.
  • With some cells in borders.

CSS

If you are attempting to display a TEI XML document directly in a commercial browser, the following CSS fragments can be used to style the element:

Basic

table {
  display:table;
}

This assumes the table is to appear as a block element (similar to a paragraph). Tables used in-line should have their @display set to inline-table. The table has no borders.

With thin single borders

The following adds a thin solid border around the table. Setting to border collapse to collapse ensures that only a single line appears between rows, columns, with borders.

table {
  display:table;
  border: thin solid black;
  border-collapse: collapse;
}

For additional CSS table styles, see [[Table#CSS | Table[] (part of the Category:How_do_I_encode... binder).

XSLT

Conversion to XHTML

If you are going to convert your TEI table to XHTML, the minimal template looks like this

<xsl:template match="table">
  <table><xsl:apply-templates/></table>
</xsl:template>

<xsl:template match="row">
  <tr><xsl:apply-templates/></tr>
</xsl:template>

<xsl:template match="cell">
  <td><xsl:apply-templates/></td>
</xsl:template>

CSS styles for this element are as above.

Related topics

Bold text

Personal tools