<tabular>

The <tabular> tag is the workhorse tag for displaying a collection of cells presented in rows and columns; in most contexts this environment would be called a table, but in PreTeXt a <table> is simply one of many possible wrappers for a <tabular>. For complex tabulars, there is an online table builder which can generate PreTeXt output.

Syntax

Attributes

Attributes for <tabular>
AttributeRequired?Values
bottom = "…"optional"none""minor""medium""major"
component = "…"optionalstring
halign = "…"optional"left""center""right""justify"
left = "…"optional"none""minor""medium""major"
margins = "…"optionalstring
right = "…"optional"none""minor""medium""major"
row-headers = "…"optional"yes""no"
top = "…"optional"none""minor""medium""major"
valign = "…"optional"top""middle""bottom"
width = "…"optionalstring

Children

The following may appear as children:<col> <row>

Parents

This element may appear as an immediate child of the following elements: <abstract> <acknowledgement> <activity> <algorithm> <answer> <appendix> <article> <aside> <assemblage> <biographical> <biography> <case> <chapter> <claim> <colophon> <computation> <conclusion> <convention> <corollary> <data> <description> <example> <exercise> <exploration> <fact> <gi> <headnote> <hint> <historical> <identity> <insight> <introduction> <investigation> <lemma> <li> <note> <observation> <paragraphs> <postlude> <preface> <prelude> <problem> <project> <proof> <proposition> <question> <remark> <section> <sidebyside> <solution> <stack> <statement> <subsection> <subsubsection> <table> <task> <technology> <theorem> <warning>

Notes

A note about tabular borders

Placing borders in tabulars exactly where you want them requires that you understand in which elements the attributes top, left, bottom, and right may be applied. Note that while horizontal borders (rules) are easy, vertical rules have been made intentionally more work “to gently guide authors towards good choices” in document design. The section of the PreTeXt Guide on Tables and Tabulars is the definitive source.

Examples

A simple tabular wrapper in a <table>.

In this example, all cell entries are right-justified; the table has a header row and some cells have borders.

A tabular example wrapped by an <activity> instead of a <table>.

A table with paragraphs and alignment variations