<section xml:id="table-calisthenics" label="section-table-calisthenics">
<title>Table Calisthenics</title>
<sage>
<input>
c = 832
c
</input>
</sage>
<p>
That was a Sage cell just now,
which has nothing to do with tables.
But we needed someplace to test placement right after a division heading.
Carry on.
</p>
<p>
A very minimal table, hence with left-justified cells,
no borders.
We do wrap the tabular element in a table element to get centering,
numbering and a caption.
Footnotes inside cells are tested here.
</p>
<table>
<title>Some Colors</title>
<tabular>
<row>
<cell>Red</cell>
<cell>Green<fn>
Green can be a very sick looking color.
</fn></cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
<p>
Note that tables may be constructed using the
<url href="http://www.latex-tables.com/" visual="www.latex-tables.com"><latex /> Complex Table Editor</url>
tool online at <c>latex-tables.com</c> and then exported in <pretext /> syntax.
</p>
<p>
Tables can be used and abused many ways.
We describe long division of polynomials by using vertical and horizontal borders on individual entries of a <tag>tabular</tag>.
The division lines are slightly thicker than the subtraction lines.
This is a good example of the typical abuse of tables for horizontal and vertical layout.
At least we have called it a
<q>Figure,</q>
not a
<q>Table</q>.
</p>
<figure>
<caption>Polynomial Long Division</caption>
<tabular halign="right">
<row>
<cell />
<cell />
<cell />
<cell bottom="medium" />
<cell bottom="medium" />
<cell bottom="medium"><m>x</m></cell>
<cell bottom="medium"><m>-</m></cell>
<cell bottom="medium"><m>5</m></cell>
</row>
<row>
<cell><m>x</m></cell>
<cell><m>+</m></cell>
<cell right="medium"><m>2</m></cell>
<cell><m>x^2</m></cell>
<cell><m>-</m></cell>
<cell><m>3x</m></cell>
<cell><m>-</m></cell>
<cell><m>8</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell bottom="minor"><m>x^2</m></cell>
<cell bottom="minor"><m>+</m></cell>
<cell bottom="minor"><m>2x</m></cell>
<cell bottom="minor" />
<cell bottom="minor" />
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell><m>-5x</m></cell>
<cell><m>-</m></cell>
<cell><m>8</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell bottom="minor"><m>-5x</m></cell>
<cell bottom="minor"><m>-</m></cell>
<cell bottom="minor"><m>10</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell><m>2</m></cell>
</row>
</tabular>
</figure>
<p>
An example of aligning table cells' contents horizontally.
See the source for comments.
</p>
<table>
<title>Horizontal Alignment Example</title>
<tabular halign="right">
<col />
<col />
<col halign="center" />
<col />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row>
<cell>[First</cell>
<cell>Second</cell>
<cell>Third</cell>
<cell>Fourth</cell>
</row>
<row>
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell>1</cell>
<cell halign="center">2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
<p>
Example from above, but now with horizontal rules,
plus an extra row to test the bottom border.
See the source for comments.
</p>
<table xml:id="horizontal-rules-table">
<title>Horizontal Rules Example</title>
<tabular bottom="minor" top="major" halign="right">
<col top="minor" />
<col />
<col top="none" halign="center" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell>4</cell>
</row>
<row bottom="medium">
<cell>1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
<p>
For a table without a caption,
create a <tag>tabular</tag> and place it directly within the current division.
This will allow control over the horizontal placment, but without a caption,
there is no number, and the tabular cannot be cross-referenced.
</p>
<tabular top="medium">
<row bottom="medium" left="minor">
<cell right="minor">One</cell>
</row>
</tabular>
<p>
Same example as before, but now with vertical rules.
See the source for comments.
</p>
<table>
<title>Vertical Rules Example</title>
<tabular bottom="minor" top="major" left="major" right="medium" halign="right">
<col top="minor" />
<col />
<col top="none" halign="center" right="none" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell right="minor">1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major" right="medium">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row left="none" halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell right="major">4</cell>
</row>
<row bottom="medium">
<cell right="none">1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
<table>
<title>Progressively Thicker Rules Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell>1111</cell>
<cell>2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell>bbbb</cell>
<cell right="medium">cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
<table>
<title>Column Span Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
<p>
A list whose first item is a table.
In <latex /> output a <c>\leavevmode</c> is necessary to keep this organized
(item number, <em>then</em> table as content).
</p>
<p>
<ol>
<li>
<table>
<title>Table Alignment Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
</li>
</ol>
</p>
<example>
<title>Example Environment with Leading Table</title>
<table>
<title>Column Spans, No <c>col</c> Elements, Nine Columns</title>
<tabular>
<row left="minor">
<cell right="minor">1</cell>
<cell colspan="2" right="minor">2+3</cell>
<cell right="minor">4</cell>
<cell colspan="3" right="medium">5+6+7</cell>
<cell colspan="2" right="major">8+9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell colspan="2" right="minor">7+8</cell>
<cell right="minor">9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell right="minor">7</cell>
<cell right="minor">8</cell>
<cell right="minor">9</cell>
</row>
</tabular>
</table>
<p>
This example tests several things.
In <latex /> output, figures,
tables, listings and side-by-sides are
<q>floats</q>
whose placement can migrate, but we have tries to supress this behavior.
However, a float that is the first item of an
<q>environment</q>
(like a theorem or an example) can still float to a position
<em>before</em> its title.
If that does not happen here,
then our additional defenses are working.
</p>
<p>
This example also checks that the total number of columns is correctly computed from the first row,
which features several <c>colspan</c> attributes.
</p>
</example>
<p>
A bare minimum table
(one row with one cell)
to test edge cases:
</p>
<table xml:id="table-minimal">
<title>One entry table</title>
<tabular top="medium">
<row bottom="medium" left="minor">
<cell right="minor">One</cell>
</row>
</tabular>
</table>
<p>
Table cells with a fixed width where text wraps are known as
<q>paragraph cells</q>. A cell will be created as a paragraph cell if and only if it has <tag>p</tag> children.
And such cells should <em>only</em>
have <tag>p</tag> children.
The width of a paragraph cell is determined by a <c>width</c> attribute on the corresponding <tag>col</tag>
(as a percentage).
If the column has a non-paragraph cell with contents that are wider than the paragraph cells,
results will be undesirable.
There is presently no implementation for a paragraph cell that has a <c>colspan</c> greater than <m>1</m>,
although cells with <c>colspan</c> greater than <m>1</m> that are above or below a paragraph cell will behave.
Setting <c>width</c> on a <tag>col</tag> that has no paragraph cells may produce unexpected results.
A <c>valign</c> for the parent <tag>row</tag>
(or the ambient <tag>tabular</tag>)
can control vertical alignment
(top, middle, or bottom).
A paragraph cell's <c>halign</c> attribute (left, center,
right, or justify) controls how the text is justfied.
Cells inherit <c>halign</c> from <tag>row</tag>,
<tag>col</tag>,
and <tag>tabular</tag> in that order of preference.
In a non-paragraph cell where <c>halign='justify'</c>,
the horizontal alignment will match the behavior of <c>halign='left'</c>.
</p>
<table xml:id="table-time-units">
<title>Time Units</title>
<tabular top="major">
<col />
<col />
<col width="40%" />
<col width="25%" />
<row valign="top" bottom="medium">
<cell>Unit</cell>
<cell>Stands For</cell>
<cell>Definition</cell>
<cell>Roughly</cell>
</row>
<row valign="top" bottom="minor">
<cell><quantity>
<unit base="second" />
</quantity></cell>
<cell>second</cell>
<cell>
<p>
the duration of
<quantity>
<mag>9192631770</mag>
</quantity>
periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium-133 atom
</p>
<p>
an extraneous paragraph just to demonstrate the inter-paragraph formatting.
</p>
</cell>
<cell>
<p>
the time it takes you to say the phrase
<q>differential calculus</q>
</p>
</cell>
</row>
<row valign="top" bottom="minor">
<cell><quantity>
<unit base="minute" />
</quantity></cell>
<cell>minute</cell>
<cell>
<p>
exactly <m>60</m> seconds
</p>
</cell>
<cell>
<p>
how long it takes to microwave a full dinner plate from the refrigerator
</p>
</cell>
</row>
<row valign="top" bottom="major">
<cell><quantity>
<unit base="hour" />
</quantity></cell>
<cell>hour</cell>
<cell>
<p>
exactly <m>3600</m> seconds;
exaclty <m>60</m> minutes
</p>
</cell>
<cell>
<p>
the length of one episode of a premium cable television show
</p>
</cell>
</row>
</tabular>
</table>
<p>
Table cells can have multiline content using <tag>line</tag> elements.
This is not the same thing as a paragraph cell<mdash />line breaking will happen precisely where the author tells it to.
A <tag>line</tag> will not break, even on a narrow screen.
If a cell uses a <tag>line</tag>,
it must only use a sequence of <tag>line</tag>s and no other content.
As with paragraph cells,
you can use a <c>valign</c> attribute for the row.
</p>
<table xml:id="table-multiline-cells">
<title><abbr>Dr.</abbr> Seuss lines</title>
<tabular top="medium" left="medium" bottom="medium" right="medium">
<row valign="bottom">
<cell>
<line>One Fish</line>
<line>Two Fish</line>
<line>Red Fish</line>
<line>Blue Fish</line></cell>
<cell>
<line>I am the Lorax.</line>
<line>I speak for the trees.</line>
<line>Self-referential: <xref ref="table-multiline-cells" text="type-global" /></line></cell>
<cell>
<line>Look at me!</line>
<line>Look at me!</line>
<line>Look at me NOW!</line>
<line>It is fun to have fun.</line>
<line>But you have</line>
<line>to know how.</line></cell>
</row>
</tabular>
</table>
<p>
This is a table torture test with many combinations of <c>halign</c>,
<c>valign</c>,
<c>colspan</c>,
<tag>p</tag> children,
and <tag>line</tag> children.
</p>
<table>
<title>Table Torture Test</title>
<tabular top="minor" bottom="minor" right="minor" left="minor">
<col />
<col width="10%" />
<col halign="right" />
<col width="10%" halign="right" />
<col halign="center" />
<col width="10%" halign="center" />
<col halign="justify" />
<col width="10%" halign="justify" />
<col />
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell>Cell too wide</cell>
<cell />
</row>
<row>
<cell>Lf md</cell>
<cell>
<p>
Lef mid par cel
</p>
</cell>
<cell>Rt md</cell>
<cell>
<p>
Rig mid par cel
</p>
</cell>
<cell>Cn md</cell>
<cell>
<p>
Cen mid par cel
</p>
</cell>
<cell>Js md</cell>
<cell>
<p>
Jus mid par cel jus mid par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row>
<cell colspan="2">
<line>Colspan=2</line>
<line>lef mid</line>
<line>with lines</line></cell>
<cell colspan="3">Colspan=3 rig mid</cell>
<cell>
<line>Lines</line>
<line>Between</line>
<line>Par</line></cell>
<cell>
<line>Lines</line>
<line>Between</line>
<line>No Par</line></cell>
<cell>
<p>
Par in row with lines
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="top">
<cell>L t</cell>
<cell>
<p>
Lef top par cel
</p>
</cell>
<cell>R t</cell>
<cell>
<p>
Rig top par cel
</p>
</cell>
<cell>C t</cell>
<cell>
<p>
Cen top par cel
</p>
</cell>
<cell>J t</cell>
<cell>
<p>
Jus top par cel jus top par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="bottom">
<cell>L b</cell>
<cell>
<p>
Lef bot par cel
</p>
</cell>
<cell>R b</cell>
<cell>
<p>
Rig bot par cel
</p>
</cell>
<cell>C b</cell>
<cell>
<p>
Cen bot par cel
</p>
</cell>
<cell>J b</cell>
<cell>
<p>
Jus bot par cel jus bot par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="bottom">
<cell colspan="3">Colspan=3 lef bot</cell>
<cell colspan="2">
<line>Colspan=2</line>
<line>rig bot</line>
<line>with lines</line></cell>
<cell>
<line>Lines</line>
<line>Under</line>
<line>Par</line></cell>
<cell>
<line>Lines</line>
<line>Under</line>
<line>No Par</line></cell>
<cell>
<p>
Par in row with lines
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
</tabular>
</table>
<p>
And now a <tag>sidebyside</tag> with a <tag>table</tag> and a <tag>tabular</tag> to check that width is scaled appropriately.
See <xref ref="section-side-by-side">Section</xref>
to learn about <tag>sidebyside</tag>s.
</p>
<figure xml:id="table-consitution-text">
<caption>Some text from the US Constitution</caption>
<sidebyside widths="45% 55%">
<tabular valign="top" top="minor" bottom="minor" left="minor" right="minor">
<col />
<col width="50%" />
<row>
<cell>A1.S1</cell>
<cell>
<p>
All legislative Powers herein granted shall be vested in a Congress of the United States,
which shall consist of a Senate and House of Representatives.
</p>
<p>
Should be 50% of 45% except perhaps on small screens.
</p>
</cell>
</row>
</tabular>
<tabular valign="top" top="minor" bottom="minor" left="minor" right="minor">
<col />
<col width="50%" />
<row>
<cell>A1.S2.C1</cell>
<cell>
<p>
The House of Representatives shall be composed of Members chosen every second Year by the People of the several States,
and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature.
</p>
<p>
Should be 50% of 55% except perhaps on small screens.
</p>
</cell>
</row>
</tabular>
</sidebyside>
</figure>
<p>
Tables are formed in <latex /> output with copious use of the <c>\multicolumn</c> macro to override more global alignment settings,
and to spread the content of one cell across several columns.
However, sometimes <latex />'s special characters have behaved badly in this situation.
So the table below, two items per row,
is just designed for <latex /> testing.
But of course, it should still render fine in other formats.
The three test cases are from <xref ref="section-urls" type="text-global" />,
but without 50 alphabetic characters and 8 digits,
which should not be problems in this context.
In order to test the use of a percent sign (<c>%</c>) in a URL, we follow it by two hex digits,
specifically,
<c>58</c>,
which is a way to represent the character <c>X</c> in a <init>URL</init>.
The first column's entries are <em>forced</em>
to be wrapped in a <c>\multicolumn</c> by specifying their horizontal alignment.
The second column's entries <em>will not</em>
be wrapped in a <c>\multicolumn</c>.
So the two columns will look identical,
other than the first having a left alignment,
and the second has the default center alignment.
(This table is known to render poorly in a Jupyter notebook.
The cause is four dollar signs present in rows 1 and 3, and is explained in <xref ref="subsection-jupyter-dollars" text="type-global" />.)
</p>
<table xml:id="table-latex-problems">
<title>Problematic Table Cells for <latex /></title>
<tabular halign="center" top="medium" left="medium" bottom="medium" right="medium">
<row>
<cell>1</cell>
<cell halign="left"><c>09az%-._~:/?#[]@!$&'()*+,;=</c></cell>
<cell><c>09az%-._~:/?#[]@!$&'()*+,;=</c></cell>
</row>
<row>
<cell>2</cell>
<cell halign="left">
<url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=">e.com/09az%58-._~:/?#[]@!$&'()*+,;=</url>
</cell>
<cell>
<url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=">e.com/09az%58-._~:/?#[]@!$&'()*+,;=</url>
</cell>
</row>
<row>
<cell>3</cell>
<cell halign="left"><url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=" /></cell>
<cell><url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=" /></cell>
</row>
</tabular>
</table>
<p>
Now, the same table repeatedly,
but with different headers.
No care has been taken with alignment or rules,
which could improve how these look.
</p>
<table>
<title>No Headers</title>
<tabular>
<row>
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Row Header</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Row Header, Multiline</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>Two Row Headers</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="yes">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Vertical Row Header</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Vertical Row Header, Multiline</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>Two Vertical Row Headers</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="vertical">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Row Header, with Rules</title>
<tabular>
<row header="yes" bottom="major">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<table>
<title>One Row Header, Multiline, with Rules</title>
<tabular>
<row header="yes" bottom="major">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<p>
The next table has a progression of thicker rules in the header,
plus a progression of thicker rules across the columns.
For testing, not for aesthetics.
</p>
<table>
<title>Two Row Header, Many Rules</title>
<tabular top="minor" left="minor">
<col right="minor" />
<col right="medium" />
<col />
<col right="major" />
<row header="yes" bottom="medium">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="yes" bottom="major">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
<p>
We now finish this section with some <em>long</em> tables.
Ones that will not fit on a single printed page.
So this is only of interest when producing this sample article as a <init>PDF</init>.
First a
<q>naked</q>
tabular, which should force a new page to start,
and then still overrun the end of the page.
</p>
<tabular>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
<p>
Now the same <tag>tabular</tag>,
but within a <tag>table</tag>.
Behavior should be similar,
a new page and then it overruns the bottom of the page.
</p>
<table>
<title>A Lot of Colors</title>
<tabular>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
<p>
When you wish to allow a <tag>tabular</tag> to split itself at a page break,
you can add the attribute <attr>break</attr> with the value <c>yes</c>.
Certainly this will control a <tag>table</tag> or <tag>tabular</tag> which is longer than a page,
but will also allow a shorter one to break.
This might useful in a draft stage before undertaking page-fitting.
</p>
<p>
Here is the long <tag>tabular</tag> again,
but with the <attr>break</attr> attribute set to <c>yes</c>.
</p>
<tabular break="yes">
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
<p>
Here is the long <tag>table</tag> again,
but with the <attr>break</attr> attribute set to <c>yes</c> on the <attr>tabular</attr>.
</p>
<table>
<title>A Lot of Colors, Breaking</title>
<tabular break="yes">
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
<p>
This device is not ideal,
as some features of tables are not behaving as expected.
More precisely,
we switch from the standard <latex /> <c>tabular</c> environment to the <c>longtable</c> environment from the package of the same name when table-breaking is requested.
So there may be some undesirable interaction with other packages.
For one, full-width horizontal rules seem to become as wide as the page
(rather than as wide as the tabular).
The following table is <xref ref="horizontal-rules-table" text="type-global" /> repeated but as a breakable <tag>tabular</tag>.
The <c>longtable</c> package documentation suggests it accomodates the <c>array</c> package,
but it also seems to make a variety of redefinitions.
Furthermore,
a panel of a side-by-side cannot be a breakable tabular,
or a <latex /> compilation error occurs.
</p>
<table xml:id="horizontal-rules-breakable-table">
<title>Horizontal Rules Example</title>
<tabular bottom="minor" top="major" halign="right" break="yes">
<col top="minor" />
<col />
<col top="none" halign="center" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell>4</cell>
</row>
<row bottom="medium">
<cell>1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
<p>
Here is a consecutive pair of
<q>bare</q>
<tag>tabular</tag> to test vertical space between them.
</p>
<tabular top="medium" bottom="medium" halign="center">
<col right="minor" />
<col />
<col />
<col />
<col />
<row bottom="minor">
<cell><m>t</m></cell>
<cell><m>2/3</m></cell>
<cell><m>2/303</m></cell>
<cell><m>2/30003</m></cell>
<cell><m>2/3000003</m></cell>
</row>
<row>
<cell><m>g(t)</m></cell>
<cell><m>-1</m></cell>
<cell><m>-1</m></cell>
<cell><m>-1</m></cell>
<cell><m>-1</m></cell>
</row>
</tabular>
<tabular top="medium" bottom="medium" halign="center">
<col right="minor" />
<col />
<col />
<col />
<col />
<row bottom="minor">
<cell><m>t</m></cell>
<cell><m>2/5</m></cell>
<cell><m>2/505</m></cell>
<cell><m>2/50005</m></cell>
<cell><m>2/5000005</m></cell>
</row>
<row>
<cell><m>g(t)</m></cell>
<cell><m>1</m></cell>
<cell><m>1</m></cell>
<cell><m>1</m></cell>
<cell><m>1</m></cell>
</row>
</tabular>
<p>
The <c>longtable</c> package allows for headers and footers indicating continued tables.
A possible enhancement is to support this feature in the case of a long table.
</p>
</section>
Section 13 Table Calisthenics
View Source for section
That was a Sage cell just now, which has nothing to do with tables. But we needed someplace to test placement right after a division heading. Carry on.
A very minimal table, hence with left-justified cells, no borders. We do wrap the tabular element in a table element to get centering, numbering and a caption. Footnotes inside cells are tested here.
View Source for table
<table>
<title>Some Colors</title>
<tabular>
<row>
<cell>Red</cell>
<cell>Green<fn>
Green can be a very sick looking color.
</fn></cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
Red | Green1Green can be a very sick looking color. |
Yellow |
Blue | White | Pink |
Note that tables may be constructed using the LaTeX Complex Table Editor tool online at
2
www.latex-tables.com
latex-tables.com
and then exported in PreTeXt syntax.Tables can be used and abused many ways. We describe long division of polynomials by using vertical and horizontal borders on individual entries of a
<tabular>
. The division lines are slightly thicker than the subtraction lines. This is a good example of the typical abuse of tables for horizontal and vertical layout. At least we have called it a “Figure,” not a “Table”.View Source for figure
<figure>
<caption>Polynomial Long Division</caption>
<tabular halign="right">
<row>
<cell />
<cell />
<cell />
<cell bottom="medium" />
<cell bottom="medium" />
<cell bottom="medium"><m>x</m></cell>
<cell bottom="medium"><m>-</m></cell>
<cell bottom="medium"><m>5</m></cell>
</row>
<row>
<cell><m>x</m></cell>
<cell><m>+</m></cell>
<cell right="medium"><m>2</m></cell>
<cell><m>x^2</m></cell>
<cell><m>-</m></cell>
<cell><m>3x</m></cell>
<cell><m>-</m></cell>
<cell><m>8</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell bottom="minor"><m>x^2</m></cell>
<cell bottom="minor"><m>+</m></cell>
<cell bottom="minor"><m>2x</m></cell>
<cell bottom="minor" />
<cell bottom="minor" />
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell><m>-5x</m></cell>
<cell><m>-</m></cell>
<cell><m>8</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell bottom="minor"><m>-5x</m></cell>
<cell bottom="minor"><m>-</m></cell>
<cell bottom="minor"><m>10</m></cell>
</row>
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell><m>2</m></cell>
</row>
</tabular>
</figure>
\(x\) | \(-\) | \(5\) | |||||
\(x\) | \(+\) | \(2\) | \(x^2\) | \(-\) | \(3x\) | \(-\) | \(8\) |
\(x^2\) | \(+\) | \(2x\) | |||||
\(-5x\) | \(-\) | \(8\) | |||||
\(-5x\) | \(-\) | \(10\) | |||||
\(2\) |
An example of aligning table cells’ contents horizontally. See the source for comments.
View Source for table
<table>
<title>Horizontal Alignment Example</title>
<tabular halign="right">
<col />
<col />
<col halign="center" />
<col />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row>
<cell>[First</cell>
<cell>Second</cell>
<cell>Third</cell>
<cell>Fourth</cell>
</row>
<row>
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell>1</cell>
<cell halign="center">2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
1234567890 | 1234567890 | 1234567890 | 1234567890 |
[First | Second | Third | Fourth |
A | B | C | D |
1 | 2 | 3 | 4 |
Example from above, but now with horizontal rules, plus an extra row to test the bottom border. See the source for comments.
View Source for table
<table xml:id="horizontal-rules-table">
<title>Horizontal Rules Example</title>
<tabular bottom="minor" top="major" halign="right">
<col top="minor" />
<col />
<col top="none" halign="center" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell>4</cell>
</row>
<row bottom="medium">
<cell>1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
1234567890 | 1234567890 | 1234567890 | 1234567890 |
First | Second | Third | Fourth |
A | B | C | D |
1 | 2 | 3 | 4 |
1 | 2 | 3 | 4 |
For a table without a caption, create a
<tabular>
and place it directly within the current division. This will allow control over the horizontal placment, but without a caption, there is no number, and the tabular cannot be cross-referenced.One |
Same example as before, but now with vertical rules. See the source for comments.
View Source for table
<table>
<title>Vertical Rules Example</title>
<tabular bottom="minor" top="major" left="major" right="medium" halign="right">
<col top="minor" />
<col />
<col top="none" halign="center" right="none" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell right="minor">1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major" right="medium">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row left="none" halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell right="major">4</cell>
</row>
<row bottom="medium">
<cell right="none">1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
1234567890 | 1234567890 | 1234567890 | 1234567890 |
First | Second | Third | Fourth |
A | B | C | D |
1 | 2 | 3 | 4 |
1 | 2 | 3 | 4 |
View Source for table
<table>
<title>Progressively Thicker Rules Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell>1111</cell>
<cell>2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell>bbbb</cell>
<cell right="medium">cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
1111 | 2222 | 3333 |
aaaa | bbbb | cccc |
AAAA | BBBB | CCCC |
View Source for table
<table>
<title>Column Span Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
1111, 2222 | 3333 | |
aaaa | bbbb,cccc | |
AAAA | BBBB | CCCC |
A list whose first item is a table. In LaTeX output a
\leavevmode
is necessary to keep this organized (item number, then table as content).View Source for table
<table> <title>Table Alignment Example</title> <tabular top="minor" left="minor" halign="center"> <col right="medium" /> <col right="major" /> <col /> <row bottom="medium"> <cell colspan="2">1111, 2222</cell> <cell right="minor">3333</cell> </row> <row bottom="major"> <cell>aaaa</cell> <cell colspan="2" right="medium">bbbb,cccc</cell> </row> <row> <cell bottom="minor">AAAA</cell> <cell bottom="medium">BBBB</cell> <cell bottom="major" right="major">CCCC</cell> </row> </tabular> </table>
Table 13.8. Table Alignment Example 1111, 2222 3333 aaaa bbbb,cccc AAAA BBBB CCCC
Example 13.9. Example Environment with Leading Table.
View Source for example
<example>
<title>Example Environment with Leading Table</title>
<table>
<title>Column Spans, No <c>col</c> Elements, Nine Columns</title>
<tabular>
<row left="minor">
<cell right="minor">1</cell>
<cell colspan="2" right="minor">2+3</cell>
<cell right="minor">4</cell>
<cell colspan="3" right="medium">5+6+7</cell>
<cell colspan="2" right="major">8+9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell colspan="2" right="minor">7+8</cell>
<cell right="minor">9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell right="minor">7</cell>
<cell right="minor">8</cell>
<cell right="minor">9</cell>
</row>
</tabular>
</table>
<p>
This example tests several things.
In <latex /> output, figures,
tables, listings and side-by-sides are
<q>floats</q>
whose placement can migrate, but we have tries to supress this behavior.
However, a float that is the first item of an
<q>environment</q>
(like a theorem or an example) can still float to a position
<em>before</em> its title.
If that does not happen here,
then our additional defenses are working.
</p>
<p>
This example also checks that the total number of columns is correctly computed from the first row,
which features several <c>colspan</c> attributes.
</p>
</example>
View Source for table
<table>
<title>Column Spans, No <c>col</c> Elements, Nine Columns</title>
<tabular>
<row left="minor">
<cell right="minor">1</cell>
<cell colspan="2" right="minor">2+3</cell>
<cell right="minor">4</cell>
<cell colspan="3" right="medium">5+6+7</cell>
<cell colspan="2" right="major">8+9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell colspan="2" right="minor">7+8</cell>
<cell right="minor">9</cell>
</row>
<row left="minor">
<cell right="minor">1</cell>
<cell right="minor">2</cell>
<cell right="minor">3</cell>
<cell right="minor">4</cell>
<cell right="minor">5</cell>
<cell right="minor">6</cell>
<cell right="minor">7</cell>
<cell right="minor">8</cell>
<cell right="minor">9</cell>
</row>
</tabular>
</table>
col
Elements, Nine Columns1 | 2+3 | 4 | 5+6+7 | 8+9 | ||||
1 | 2 | 3 | 4 | 5 | 6 | 7+8 | 9 | |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
This example tests several things. In LaTeX output, figures, tables, listings and side-by-sides are “floats” whose placement can migrate, but we have tries to supress this behavior. However, a float that is the first item of an “environment” (like a theorem or an example) can still float to a position before its title. If that does not happen here, then our additional defenses are working.
This example also checks that the total number of columns is correctly computed from the first row, which features several
colspan
attributes.A bare minimum table (one row with one cell) to test edge cases:
View Source for table
<table xml:id="table-minimal">
<title>One entry table</title>
<tabular top="medium">
<row bottom="medium" left="minor">
<cell right="minor">One</cell>
</row>
</tabular>
</table>
One |
Table cells with a fixed width where text wraps are known as “paragraph cells”. A cell will be created as a paragraph cell if and only if it has
<p>
children. And such cells should only have <p>
children. The width of a paragraph cell is determined by a width
attribute on the corresponding <col>
(as a percentage). If the column has a non-paragraph cell with contents that are wider than the paragraph cells, results will be undesirable. There is presently no implementation for a paragraph cell that has a colspan
greater than \(1\text{,}\) although cells with colspan
greater than \(1\) that are above or below a paragraph cell will behave. Setting width
on a <col>
that has no paragraph cells may produce unexpected results. A valign
for the parent <row>
(or the ambient <tabular>
) can control vertical alignment (top, middle, or bottom). A paragraph cell’s halign
attribute (left, center, right, or justify) controls how the text is justfied. Cells inherit halign
from <row>
, <col>
, and <tabular>
in that order of preference. In a non-paragraph cell where halign='justify'
, the horizontal alignment will match the behavior of halign='left'
.View Source for table
<table xml:id="table-time-units">
<title>Time Units</title>
<tabular top="major">
<col />
<col />
<col width="40%" />
<col width="25%" />
<row valign="top" bottom="medium">
<cell>Unit</cell>
<cell>Stands For</cell>
<cell>Definition</cell>
<cell>Roughly</cell>
</row>
<row valign="top" bottom="minor">
<cell><quantity>
<unit base="second" />
</quantity></cell>
<cell>second</cell>
<cell>
<p>
the duration of
<quantity>
<mag>9192631770</mag>
</quantity>
periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium-133 atom
</p>
<p>
an extraneous paragraph just to demonstrate the inter-paragraph formatting.
</p>
</cell>
<cell>
<p>
the time it takes you to say the phrase
<q>differential calculus</q>
</p>
</cell>
</row>
<row valign="top" bottom="minor">
<cell><quantity>
<unit base="minute" />
</quantity></cell>
<cell>minute</cell>
<cell>
<p>
exactly <m>60</m> seconds
</p>
</cell>
<cell>
<p>
how long it takes to microwave a full dinner plate from the refrigerator
</p>
</cell>
</row>
<row valign="top" bottom="major">
<cell><quantity>
<unit base="hour" />
</quantity></cell>
<cell>hour</cell>
<cell>
<p>
exactly <m>3600</m> seconds;
exaclty <m>60</m> minutes
</p>
</cell>
<cell>
<p>
the length of one episode of a premium cable television show
</p>
</cell>
</row>
</tabular>
</table>
Unit | Stands For | Definition | Roughly |
s | second |
the duration of 9192631770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium-133 atom
an extraneous paragraph just to demonstrate the inter-paragraph formatting.
|
the time it takes you to say the phrase “differential calculus” |
min | minute | exactly \(60\) seconds |
how long it takes to microwave a full dinner plate from the refrigerator |
h | hour | exactly \(3600\) seconds; exaclty \(60\) minutes |
the length of one episode of a premium cable television show |
Table cells can have multiline content using
<line>
elements. This is not the same thing as a paragraph cell—line breaking will happen precisely where the author tells it to. A <line>
will not break, even on a narrow screen. If a cell uses a <line>
, it must only use a sequence of <line>
s and no other content. As with paragraph cells, you can use a valign
attribute for the row.View Source for table
<table xml:id="table-multiline-cells">
<title><abbr>Dr.</abbr> Seuss lines</title>
<tabular top="medium" left="medium" bottom="medium" right="medium">
<row valign="bottom">
<cell>
<line>One Fish</line>
<line>Two Fish</line>
<line>Red Fish</line>
<line>Blue Fish</line></cell>
<cell>
<line>I am the Lorax.</line>
<line>I speak for the trees.</line>
<line>Self-referential: <xref ref="table-multiline-cells" text="type-global" /></line></cell>
<cell>
<line>Look at me!</line>
<line>Look at me!</line>
<line>Look at me NOW!</line>
<line>It is fun to have fun.</line>
<line>But you have</line>
<line>to know how.</line></cell>
</row>
</tabular>
</table>
One Fish Two Fish Red Fish Blue Fish |
I am the Lorax. I speak for the trees. Self-referential: Table 13.13 |
Look at me! Look at me! Look at me NOW! It is fun to have fun. But you have to know how. |
This is a table torture test with many combinations of
halign
, valign
, colspan
, <p>
children, and <line>
children.View Source for table
<table>
<title>Table Torture Test</title>
<tabular top="minor" bottom="minor" right="minor" left="minor">
<col />
<col width="10%" />
<col halign="right" />
<col width="10%" halign="right" />
<col halign="center" />
<col width="10%" halign="center" />
<col halign="justify" />
<col width="10%" halign="justify" />
<col />
<row>
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell />
<cell>Cell too wide</cell>
<cell />
</row>
<row>
<cell>Lf md</cell>
<cell>
<p>
Lef mid par cel
</p>
</cell>
<cell>Rt md</cell>
<cell>
<p>
Rig mid par cel
</p>
</cell>
<cell>Cn md</cell>
<cell>
<p>
Cen mid par cel
</p>
</cell>
<cell>Js md</cell>
<cell>
<p>
Jus mid par cel jus mid par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row>
<cell colspan="2">
<line>Colspan=2</line>
<line>lef mid</line>
<line>with lines</line></cell>
<cell colspan="3">Colspan=3 rig mid</cell>
<cell>
<line>Lines</line>
<line>Between</line>
<line>Par</line></cell>
<cell>
<line>Lines</line>
<line>Between</line>
<line>No Par</line></cell>
<cell>
<p>
Par in row with lines
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="top">
<cell>L t</cell>
<cell>
<p>
Lef top par cel
</p>
</cell>
<cell>R t</cell>
<cell>
<p>
Rig top par cel
</p>
</cell>
<cell>C t</cell>
<cell>
<p>
Cen top par cel
</p>
</cell>
<cell>J t</cell>
<cell>
<p>
Jus top par cel jus top par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="bottom">
<cell>L b</cell>
<cell>
<p>
Lef bot par cel
</p>
</cell>
<cell>R b</cell>
<cell>
<p>
Rig bot par cel
</p>
</cell>
<cell>C b</cell>
<cell>
<p>
Cen bot par cel
</p>
</cell>
<cell>J b</cell>
<cell>
<p>
Jus bot par cel jus bot par cel
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
<row valign="bottom">
<cell colspan="3">Colspan=3 lef bot</cell>
<cell colspan="2">
<line>Colspan=2</line>
<line>rig bot</line>
<line>with lines</line></cell>
<cell>
<line>Lines</line>
<line>Under</line>
<line>Par</line></cell>
<cell>
<line>Lines</line>
<line>Under</line>
<line>No Par</line></cell>
<cell>
<p>
Par in row with lines
</p>
</cell>
<cell><line /><line /><line /><line /><line /><line /></cell>
</row>
</tabular>
</table>
Cell too wide | ||||||||
Lf md | Lef mid par cel |
Rt md | Rig mid par cel |
Cn md | Cen mid par cel |
Js md | Jus mid par cel jus mid par cel |
|
Colspan=2 lef mid with lines |
Colspan=3 rig mid | Lines Between Par |
Lines Between No Par |
Par in row with lines |
|
|||
L t | Lef top par cel |
R t | Rig top par cel |
C t | Cen top par cel |
J t | Jus top par cel jus top par cel |
|
L b | Lef bot par cel |
R b | Rig bot par cel |
C b | Cen bot par cel |
J b | Jus bot par cel jus bot par cel |
|
Colspan=3 lef bot | Colspan=2 rig bot with lines |
Lines Under Par |
Lines Under No Par |
Par in row with lines |
|
And now a
<sidebyside>
with a <table>
and a <tabular>
to check that width is scaled appropriately. See Section 26 to learn about <sidebyside>
s.View Source for figure
<figure xml:id="table-consitution-text">
<caption>Some text from the US Constitution</caption>
<sidebyside widths="45% 55%">
<tabular valign="top" top="minor" bottom="minor" left="minor" right="minor">
<col />
<col width="50%" />
<row>
<cell>A1.S1</cell>
<cell>
<p>
All legislative Powers herein granted shall be vested in a Congress of the United States,
which shall consist of a Senate and House of Representatives.
</p>
<p>
Should be 50% of 45% except perhaps on small screens.
</p>
</cell>
</row>
</tabular>
<tabular valign="top" top="minor" bottom="minor" left="minor" right="minor">
<col />
<col width="50%" />
<row>
<cell>A1.S2.C1</cell>
<cell>
<p>
The House of Representatives shall be composed of Members chosen every second Year by the People of the several States,
and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature.
</p>
<p>
Should be 50% of 55% except perhaps on small screens.
</p>
</cell>
</row>
</tabular>
</sidebyside>
</figure>
A1.S1 |
All legislative Powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and House of Representatives.
Should be 50% of 45% except perhaps on small screens.
|
A1.S2.C1 |
The House of Representatives shall be composed of Members chosen every second Year by the People of the several States, and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature.
Should be 50% of 55% except perhaps on small screens.
|
Tables are formed in LaTeX output with copious use of the
\multicolumn
macro to override more global alignment settings, and to spread the content of one cell across several columns. However, sometimes LaTeX’s special characters have behaved badly in this situation. So the table below, two items per row, is just designed for LaTeX testing. But of course, it should still render fine in other formats. The three test cases are from 9.8, but without 50 alphabetic characters and 8 digits, which should not be problems in this context. In order to test the use of a percent sign (%
) in a URL, we follow it by two hex digits, specifically, 58
, which is a way to represent the character X
in a URL. The first column’s entries are forced to be wrapped in a \multicolumn
by specifying their horizontal alignment. The second column’s entries will not be wrapped in a \multicolumn
. So the two columns will look identical, other than the first having a left alignment, and the second has the default center alignment. (This table is known to render poorly in a Jupyter notebook. The cause is four dollar signs present in rows 1 and 3, and is explained in Subsection 9.12.)View Source for table
<table xml:id="table-latex-problems">
<title>Problematic Table Cells for <latex /></title>
<tabular halign="center" top="medium" left="medium" bottom="medium" right="medium">
<row>
<cell>1</cell>
<cell halign="left"><c>09az%-._~:/?#[]@!$&'()*+,;=</c></cell>
<cell><c>09az%-._~:/?#[]@!$&'()*+,;=</c></cell>
</row>
<row>
<cell>2</cell>
<cell halign="left">
<url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=">e.com/09az%58-._~:/?#[]@!$&'()*+,;=</url>
</cell>
<cell>
<url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=">e.com/09az%58-._~:/?#[]@!$&'()*+,;=</url>
</cell>
</row>
<row>
<cell>3</cell>
<cell halign="left"><url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=" /></cell>
<cell><url href="http://example.com/09az%58-._~:/?#[]@!$&'()*+,;=" visual="example.com/09az%58-._~:/?#[]@!$&'()*+,;=" /></cell>
</row>
</tabular>
</table>
1 | 09az%-._~:/?#[]@!$&'()*+,;= |
09az%-._~:/?#[]@!$&'()*+,;= |
2 |
e.com/09az%58-._~:/?#[]@!$&’()*+,;=3example.com/09az%58-._~:/?#[]@!$&'()*+,;= |
e.com/09az%58-._~:/?#[]@!$&’()*+,;=4example.com/09az%58-._~:/?#[]@!$&'()*+,;= |
3 | example.com/09az%58-._~:/?#[]@!$&'()*+,;= |
example.com/09az%58-._~:/?#[]@!$&'()*+,;= |
Now, the same table repeatedly, but with different headers. No care has been taken with alignment or rules, which could improve how these look.
View Source for table
<table>
<title>No Headers</title>
<tabular>
<row>
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) | Statehood (Year) |
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Row Header</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) | Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Row Header, Multiline</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) |
Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>Two Row Headers</title>
<tabular>
<row header="yes">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="yes">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area | Statehood |
---|---|---|---|
(sq. mi.) | (Year) | ||
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Vertical Row Header</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) | Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Vertical Row Header, Multiline</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) |
Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>Two Vertical Row Headers</title>
<tabular>
<row header="vertical">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="vertical">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row>
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area | Statehood |
---|---|---|---|
(sq. mi.) | (Year) | ||
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Row Header, with Rules</title>
<tabular>
<row header="yes" bottom="major">
<cell>State</cell>
<cell>Population</cell>
<cell>Area (sq. mi.)</cell>
<cell>Statehood (Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) | Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
View Source for table
<table>
<title>One Row Header, Multiline, with Rules</title>
<tabular>
<row header="yes" bottom="major">
<cell>State</cell>
<cell>Population</cell>
<cell>
<line>Area</line>
<line>(sq. mi.)</line></cell>
<cell>
<line>Statehood</line>
<line>(Year)</line></cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area (sq. mi.) |
Statehood (Year) |
---|---|---|---|
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
The next table has a progression of thicker rules in the header, plus a progression of thicker rules across the columns. For testing, not for aesthetics.
View Source for table
<table>
<title>Two Row Header, Many Rules</title>
<tabular top="minor" left="minor">
<col right="minor" />
<col right="medium" />
<col />
<col right="major" />
<row header="yes" bottom="medium">
<cell>State</cell>
<cell>Population</cell>
<cell>Area</cell>
<cell>Statehood</cell>
</row>
<row header="yes" bottom="major">
<cell />
<cell />
<cell>(sq. mi.)</cell>
<cell>(Year)</cell>
</row>
<row>
<cell>Washington</cell>
<cell>7,614,893</cell>
<cell>71,362</cell>
<cell>1889</cell>
</row>
<row>
<cell>Oregon</cell>
<cell>4,217,737</cell>
<cell>98,381</cell>
<cell>1859</cell>
</row>
<row bottom="minor">
<cell>California</cell>
<cell>39,512,223</cell>
<cell>163,696</cell>
<cell>1850</cell>
</row>
</tabular>
</table>
State | Population | Area | Statehood |
---|---|---|---|
(sq. mi.) | (Year) | ||
Washington | 7,614,893 | 71,362 | 1889 |
Oregon | 4,217,737 | 98,381 | 1859 |
California | 39,512,223 | 163,696 | 1850 |
We now finish this section with some long tables. Ones that will not fit on a single printed page. So this is only of interest when producing this sample article as a PDF. First a “naked” tabular, which should force a new page to start, and then still overrun the end of the page.
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Now the same
<tabular>
, but within a <table>
. Behavior should be similar, a new page and then it overruns the bottom of the page.View Source for table
<table>
<title>A Lot of Colors</title>
<tabular>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
When you wish to allow a
<tabular>
to split itself at a page break, you can add the attribute @break
with the value yes
. Certainly this will control a <table>
or <tabular>
which is longer than a page, but will also allow a shorter one to break. This might useful in a draft stage before undertaking page-fitting.Here is the long
<tabular>
again, but with the @break
attribute set to yes
.Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Here is the long
<table>
again, but with the @break
attribute set to yes
on the @tabular
.View Source for table
<table>
<title>A Lot of Colors, Breaking</title>
<tabular break="yes">
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
<row>
<cell>Red</cell>
<cell>Green</cell>
<cell>Yellow</cell>
</row>
<row>
<cell>Blue</cell>
<cell>White</cell>
<cell>Pink</cell>
</row>
</tabular>
</table>
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
Red | Green | Yellow |
Blue | White | Pink |
This device is not ideal, as some features of tables are not behaving as expected. More precisely, we switch from the standard LaTeX
tabular
environment to the longtable
environment from the package of the same name when table-breaking is requested. So there may be some undesirable interaction with other packages. For one, full-width horizontal rules seem to become as wide as the page (rather than as wide as the tabular). The following table is Table 13.4 repeated but as a breakable <tabular>
. The longtable
package documentation suggests it accomodates the array
package, but it also seems to make a variety of redefinitions. Furthermore, a panel of a side-by-side cannot be a breakable tabular, or a LaTeX compilation error occurs.View Source for table
<table xml:id="horizontal-rules-breakable-table">
<title>Horizontal Rules Example</title>
<tabular bottom="minor" top="major" halign="right" break="yes">
<col top="minor" />
<col />
<col top="none" halign="center" />
<col top="major" />
<row halign="center">
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
<cell>1234567890</cell>
</row>
<row bottom="none">
<cell>First</cell>
<cell bottom="major">Second</cell>
<cell bottom="major">Third</cell>
<cell>Fourth</cell>
</row>
<row bottom="medium">
<cell halign="center">A</cell>
<cell halign="right">B</cell>
<cell>C</cell>
<cell halign="left">D</cell>
</row>
<row halign="left">
<cell bottom="none">1</cell>
<cell halign="center" bottom="minor">2</cell>
<cell bottom="none">3</cell>
<cell>4</cell>
</row>
<row bottom="medium">
<cell>1</cell>
<cell>2</cell>
<cell>3</cell>
<cell>4</cell>
</row>
</tabular>
</table>
1234567890 | 1234567890 | 1234567890 | 1234567890 |
First | Second | Third | Fourth |
A | B | C | D |
1 | 2 | 3 | 4 |
1 | 2 | 3 | 4 |
Here is a consecutive pair of “bare”
<tabular>
to test vertical space between them.\(t\) | \(2/3\) | \(2/303\) | \(2/30003\) | \(2/3000003\) |
\(g(t)\) | \(-1\) | \(-1\) | \(-1\) | \(-1\) |
\(t\) | \(2/5\) | \(2/505\) | \(2/50005\) | \(2/5000005\) |
\(g(t)\) | \(1\) | \(1\) | \(1\) | \(1\) |
The
longtable
package allows for headers and footers indicating continued tables. A possible enhancement is to support this feature in the case of a long table.