Skip to main content

The PreTeXt Guide

Subsection 4.18.11 Summary: Table Reference

Finally, we summarize the available options for a table with…a table. Because it would take too much text to describe fully.
This table describes how to construct tables via the tabular element. The table element may be used to enclose the raw table, so as to associate a title and get vertical separation with horizontal centering.
The tabular element contains a sequence of row elements, and must contain at least one. Each row contains a sequence of cell elements and must have the same number in each row (acccounting for the use of the colspan attribute). The contents of the cell elements are the text to appear in entries of the table.
A sequence of col elements may optionally be used. But if one appears, then there must be the right number for the width of the table. They are empty elements always, and just carry information about their respective column.
Where the body of the table below has an entry, it means the attribute may be used on the element, and affects the range of the tabular described by the element. Employment of an attribute on elements to the right in the table will supersede use on elements to the left. Generally, every cell has right and bottom borders, but only cells at the left side of the table have a left border and only cells across the top have a top border. Only one cell has four borders.
Table 4.18.11.3. Tabular Elements and Attributes (p = potential)
Attributes Elements Values
tabular col row cell * = default
top × × none*, minor, medium, major
left × × none*, minor, medium, major
bottom × × × none*, minor, medium, major
right × × × none*, minor, medium, major
halign × × × × left*, center, right, justify
halign p decimal, character
header × yes/vertical/no*
row-headers × yes/no*
valign × × top, middle*, bottom
colspan × 1*, positive integer
width × percentage
colors p p p p