The foundation for setting tables is the **tabular environment**. In \begin{tabular}{ccc}, the {ccc} is a column specification that declares up front how many columns there are and how each is aligned; in the body you then separate cells with **& and end each row with \\. Horizontal rules are drawn with \hline**. This page covers those three conventions, the basic column specifiers l, c, r, and p{width}, and the difference between tabular (which builds the table’s contents) and the floating table environment (which places it as a numbered, captioned figure).
The tabular environment
tabular is the environment for setting a table of rows and columns. Its defining feature is that \begin{tabular} takes a mandatory argument right after it — the column specification. Writing \begin{tabular}{ccc} means “three centered columns,” and the number and alignment of columns declared here fix the skeleton of the whole table. Each row in the body is then written as that many cells joined by &.
Inside the table three symbols carry meaning. **& (ampersand) is the column separator between cells in the same row. \\ (two backslashes) is the row terminator that ends a row. And \hline draws a single horizontal rule** across the full width of the table at that point. The \\ after the very last row may be omitted, but to draw a rule below the last row you close it with \\ and then place \hline.
\begin{tabular}{ccc}
\hline
A & B & C \\
D & E & F \\
\hline
\end{tabular}This sets a three-column, two-row table, fenced top and bottom by a single horizontal rule each. The contents of every cell (A–F) are centered, following the c in the column spec. Spaces around & are ignored, so you may pad them in the source to line cells up for readability.
Note that \begin{tabular} also accepts an optional vertical-position argument in brackets before the column spec (\begin{tabular}[t]{…} aligns the table’s top, [b] its bottom, to the baseline of the surrounding line). By default the vertical center of the table is aligned with the line.
The basic column specifiers
The column-spec argument is written as one letter per column. There are four basics. **l is left-aligned, c is centered, and r is right-aligned; each makes the column as wide as its natural content. These do not wrap** within the line — if a cell’s content is long, the column stretches to the width of that single line, and the table can overflow the page width.
The fourth, **p{width}, behaves differently. It is a column set as a paragraph box (parbox) of the given width: when its content exceeds that width it wraps automatically** onto multiple lines. Use p{width} for columns that hold long prose. The width can be an absolute value like p{5cm} or relative to the text, like p{0.3\linewidth}. By default the contents of a p column are top-aligned and justified.
| Specifier | Alignment | Wraps? |
|---|---|---|
l | Left-aligned | No (natural width) |
c | Centered | No (natural width) |
r | Right-aligned | No (natural width) |
p{幅} | Top, justified | Yes (wraps at the given width) |
More elaborate column specs — **\multicolumn** for cells spanning several columns, *{n}{…} to repeat columns, and the array package’s m{width} (vertically centered), b{width} (bottom), and >{…} column-prefix hooks — are covered on the “Column specifiers in depth” page. With just the four l, c, r, and p{width} you can already build most tables.
Rules — horizontal and vertical
Horizontal rules are drawn with **\hline. Placed between rows (or at the top and bottom), it runs a single line across the full width of the table. Two in a row, \hline\hline, give two parallel rules (a double rule**). To rule only certain columns partway through, use \cline with a column range, as in \cline{2-3}.
Vertical rules are made by inserting **| (a vertical bar)** into the column spec. Writing {|l|c|r|} puts vertical lines at the outer edges and between all three columns, and combined with \hline it boxes every cell into a grid. Use || for a double vertical rule.
\begin{tabular}{|l|c|r|}
\hline
左 & 中央 & 右 \\
\hline
1 & 2 & 3 \\
\hline
\end{tabular}That said, the convention is to avoid heavy ruling. Vertical rules and double rules in particular are discouraged in professional typesetting. The author of the booktabs package states plainly “never use vertical rules, and never use double rules,” and the standard for journal tables is a spare design with just a few horizontal rules. Readable table design and the \toprule / \midrule / \bottomrule idiom are covered in detail on the “Rules and publication-quality tables” page.
Row breaks and row spacing
The row terminator \\ takes an optional argument. Adding a length in brackets, as in \\[2pt], inserts extra vertical space below that row (a negative value tightens it). Use it when a rule looks cramped against the text, or when you want breathing room between rows.
Note that \\ is fundamentally a line-break command: beyond ending table rows, it serves as the same “row separator” in math matrices and in alignment environments such as align. So the feel of “separate columns with &, break rows with \\” carries over directly from tables to aligned mathematics.
To widen every row uniformly, you can change the row-height multiplier with \renewcommand{\arraystretch}{1.3}. The gap between columns (6pt on each side by default) is controlled by the length \tabcolsep. These finer dimensional tweaks are also covered on the “Column specifiers in depth” and “Rules and publication-quality tables” pages.
tabular vs. the table environment
They are often confused, but **tabular and table are entirely different things**. tabular sets the table itself (the contents of rows and columns) and can go anywhere in text mode — mid-paragraph, inside a list item, within a figure’s caption, even in a footnote. tabular on its own has no caption, no number, and no placement control.
The **table environment, by contrast, is a float** that you wrap around a tabular. What table provides is a **heading with an automatic running number via \caption{…} (“Table 1,” etc.), cross-references via \label{…} and \ref{…}, and placement specifiers like [htbp]** that let LaTeX decide where on the page to put it. When a table is large and might span a page break, making it a float lets LaTeX move it to a suitable spot. The full use of the table environment (captions, numbering, placement) is left to a separate page.
\begin{table}[htbp]
\centering
\caption{四半期ごとの売上}
\begin{tabular}{lrr}
\hline
四半期 & 売上 & 前年比 \\
\hline
Q1 & 1{,}200 & +5\% \\
Q2 & 1{,}350 & +8\% \\
\hline
\end{tabular}
\end{table}Here the outer table takes charge of the numbered caption “Table 1: Quarterly sales” and the placement, while the inner tabular sets the contents. \centering centers the table horizontally. The point is the division of labor: **contents in tabular, heading and placement in table**. A tabular alone is enough to set a table, but to refer to it as “Table N” in a paper or report, wrap it in a table.
A complete example
Finally, here is a tabular that combines everything above: a left-aligned label in column 1, a wrapping p{width} column in column 2, and a right-aligned number in column 3.
\begin{tabular}{l p{5cm} r}
\hline
項目 & 説明 & 価格 \\
\hline\hline
りんご & 蜜入りの大玉。贈答にも使われる人気の品種です。 & 380 \\
みかん & 甘くて手で剥ける小ぶりの柑橘。 & 120 \\
\hline
\end{tabular}This sets a three-column table. Column 1 (“Item”) sits left at its natural width, and column 3 (“Price”) is right-aligned. Column 2 (“Description”) is a **p column 5cm wide**, so the long description wraps automatically at 5cm and that cell alone becomes multi-line (the row height grows to fit). A \hline\hline double rule sits below the header, and single \hline rules cap the top and bottom. Putting the same long text in an l or r column would stretch it sideways without wrapping — that is the decisive difference from p{width}.