Next: , Previous: , Up: Environments   [Contents][Index]


8.22 table

Synopsis:

\begin{table}[placement]
  table body
  \caption[loftitle]{title}  % optional
  \label{label}              % also optional
\end{table}

A class of floats (see Floats). They cannot be split across pages and so they are not typeset in sequence with the normal text but instead are floated to a convenient place, such as the top of a following page.

This example table environment contains a tabular

\begin{table}
  \centering\small
  \begin{tabular}{ll}
    \multicolumn{1}{c}{\textit{Author}}
      &\multicolumn{1}{c}{\textit{Piece}}  \\ \hline
    Bach            &Cello Suite Number 1  \\
    Beethoven       &Cello Sonata Number 3 \\
    Brahms          &Cello Sonata Number 1
  \end{tabular}
  \caption{Top cello pieces}
  \label{tab:cello}
\end{table}

but you can put many different kinds of content in a table: the table body may contain text, LaTeX commands, graphics, etc. It is typeset in a parbox of width \textwidth.

For the possible values of placement and their effect on the float placement algorithm, see Floats.

The label is optional; it is used for cross references (see Cross references). The \caption command is also optional. It specifies caption text title for the table. By default it is numbered. If its optional lottitle is present then that text is used in the list of tables instead of title (see Table of contents etc.).

In this example the table and caption will float to the bottom of a page, unless it is pushed to a float page at the end.

\begin{table}[b]
  \centering
  \begin{tabular}{r|p{2in}} \hline
    One &The loneliest number \\
    Two &Can be as sad as one.
         It's the loneliest number since the number one.
  \end{tabular}
  \caption{Cardinal virtues}
  \label{tab:CardinalVirtues}
\end{table}

Unofficial LaTeX2e reference manual