Tei:table

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.

Subclasses and attributes
There are no required attributes or subclasses.

or  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  set to. The table has no borders.

With thin single borders
The following adds a thin solid border around the table. Setting to border collapse to  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[] (part of the [[:Category:How_do_I_encode...  binder).

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

&lt;xsl:template match="table"&gt; &lt;table&gt;&lt;xsl:apply-templates/&gt;&lt;/table&gt; &lt;/xsl:template&gt; &lt;xsl:template match="row"&gt; &lt;tr&gt;&lt;xsl:apply-templates/&gt;&lt;/tr&gt; &lt;/xsl:template&gt; &lt;xsl:template match="cell"&gt; &lt;td&gt;&lt;xsl:apply-templates/&gt;&lt;/td&gt; &lt;/xsl:template&gt;

CSS styles for this element are as above.

Related topics
Bold text
 * Category:How_do_I_encode... &gt; Table