Table in LaTeX
A table is built with the tabular environment: the column alignment goes in braces (l, c, r), cells are separated by & and rows end with \\. The table environment adds a caption and a number. The booktabs package gives rules that look like those in published papers.
Measurement table with a caption
\begin{table}[h]
\centering
\caption{Measured pendulum periods}
\label{tab:pendulum}
\begin{tabular}{ccc}
\toprule
$L$ [m] & $t$ [s] & $T$ [s] \\
\midrule
0.50 & 14.2 & 1.42 \\
0.75 & 17.4 & 1.74 \\
\bottomrule
\end{tabular}
\end{table}Common mistakes
- Vertical lines between every column: they make the table harder to read. Published tables use only \toprule, \midrule and \bottomrule.
- A table caption below the table: by convention table captions go above, figure captions below.
- Retyping data by hand. In CamteX you can paste it from Excel or CSV and get the code.
See also
Don't want to memorize commands?
Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.