The first argument to tabular — a column specification like {lcr} — is not merely a place to list alignments. It is a small language: alongside the number of columns and their alignment, you can write here that LaTeX should insert a declaration before or after every cell, replace the space between columns, or repeat a group of columns. Most of this is not in plain tabular; it is added by the **array package**. Starting from the basic l, c, r, and p{width}, this page works through m{width} and b{width}, >{…} and <{…}, @{…} and !{…}, and *{n}{…}.
The column-spec mini-language
The four basics were covered on a separate page. **l, c, and r align left, center, and right, sizing the column to its natural content without wrapping. Only p{width} is set as a paragraph box of the given width that wraps** when its content exceeds it. In the array package’s own terms, p{width} is equivalent to \parbox[t]{width} — a top-aligned paragraph. That default of “top” is the point of contrast with the two relatives we add next.
Most of the notation introduced from here on — m/b, >/<, @/!, * — becomes available only once you put **\usepackage{array}** in the preamble. array ships with TeX Live and MiKTeX and is pulled in internally by many table packages (tabularx, booktabs, and others), so it is often already active. Even so, loading it explicitly is the safe move.
Paragraph columns — p, m, b
There are three kinds of wrapping paragraph column, differing only in the vertical position of the cell (how its box aligns within the row). Quoting the array manual directly: **p{width}** is \parbox[t], top-aligned; **m{width} centers its content vertically on the row; and b{width}** is \parbox[b], bottom-aligned. m and b are additions from the array package — plain tabular has neither.
Why this matters: it shows up when a row mixes a tall cell (a p column that wraps to several lines, or a large image) with single-line cells. With the default p (top), a neighboring short cell clings to the top of the row and does not sit level with the middle of the tall cell. Using m{width} puts that column’s content at the vertical center of the row, so it lines up naturally with a one-line neighbor. It is handy for cells holding an image, or for tables that pair a label with a long description side by side.
\usepackage{array}
% ...
\begin{tabular}{ p{3cm} m{3cm} b{3cm} }
\hline
上端揃え (p) & 縦中央 (m) & 下端揃え (b) \\
この列は parbox[t]。 & この列は行の上下中央に。 & この列は parbox[b]。 \\
\hline
\end{tabular}With identical widths and text, p, m, and b change where each cell sits vertically. In all three, note that inside a paragraph column **\parindent (paragraph indentation) defaults to 0** (you can add it back with, say, >{\setlength{\parindent}{1em}} if you want it).
| Specifier | Vertical position | Equivalent parbox | Provided by |
|---|---|---|---|
p{wd} | Top | \parbox[t]{wd} | Standard |
m{wd} | Middle | centered on the row | array |
b{wd} | Bottom | \parbox[b]{wd} | array |
Inserting around cells — >{…} and <{…}
The centerpiece of the array package is **>{decl} and <{decl}**. >{decl} inserts decl immediately before the content of each cell in that column; <{decl} inserts it immediately after. Writing >{\bfseries}l, for instance, makes every cell of a left-aligned column bold without writing \bfseries in each one. >{\itshape}c gives centered italics, >{\color{red}}r right-aligned red, and so on.
You can also put alignment declarations in >{…}. Paragraph columns (p, m, b) are justified by default, but >{\raggedright}p{4cm} makes a flush-left (ragged-right) column, >{\centering} a centered one, and >{\raggedleft} a flush-right one. This answers the fine-grained wish to “wrap, but not justify.”
There is a serious pitfall, though. The three commands \raggedright, \raggedleft, and \centering internally **redefine the row terminator \\**, so if a column using one of them in >{…} is the table’s last column, \\ stops working as “end of row,” and you get errors or broken output. The fix is to append array’s **\arraybackslash at the end** of the declaration — >{\raggedright\arraybackslash}p{4cm} restores \\ as the row break. The same applies to \centering and \raggedleft.
Another standard trick is to put a whole column into math mode. Writing >{$}c<{$} brackets each cell with $ before and $ after, so every cell in that column is set as inline math — no more typing $…$ in each numeric or symbol-heavy cell. Conversely, inside an array environment (whose cells are already in math mode), >{$}…<{$} makes the two $ cancel, putting just that column into text mode.
A caveat: what goes in >{…} and <{…} must be a declaration. Forms that take no following argument, like >{\bfseries} or >{\itshape}, are fine, but you must not end with a command that takes an argument. >{\textbf}, for example, will try to read the cell’s content as its argument and misbehave (for bold, use the declaration form \bfseries). The array manual warns that >{\textbf} “would not make the whole column bold nor would it make the first character bold.”
At the column boundary — @{…} and !{…}
Between two columns LaTeX inserts, by default, **\tabcolsep of space (6pt on each side by default, so twice that in total). Placed at that position in the spec, @{decl} removes the inter-column space there** and inserts decl instead (in the array manual’s words, it “suppresses inter-column space and inserts decl. instead”).
Two main uses. First, trimming the table’s outer padding: putting **@{}** (an empty declaration) at both ends of the spec removes the \tabcolsep to the left of the first column and to the right of the last, so the table lines up flush with the body’s left margin — a common idiom in booktabs tables. Second, inserting a separator character: to align numbers on the decimal point, split them into an integer-part column and a fractional-part column and place @{.} between them, so the periods line up at a fixed position, giving decimal alignment.
The counterpart to @{…} is **!{decl}**. It may be written where a vertical rule | would go and inserts an arbitrary decl in place of the rule. The decisive difference from @{…} is that **!{…} does not remove the normal inter-column space**. So it suits cases like “draw a dashed line between columns but keep the column padding” (for instance, placing a dashed-rule command from the arydshln package inside !{…}).
Incidentally, loading array also slightly changes how the vertical rule | behaves: the column gap widens by the thickness of the rule (in standard LaTeX the rule sits within the existing space and the gap does not grow). That said, vertical rules themselves are best avoided in professional tables — a topic left to “Rules & publication-quality tables.”
Repeating columns — *{n}{…}
When many identically-specified columns run in a row, ***{count}{spec}** folds the repetition. Per the array manual it is equivalent to “count copies of spec.” For six centered columns, write ***{6}{c}** instead of cccccc. The repeated unit may be several specifiers: *{3}{|c}| expands to |c|c|c|. It is especially useful for repeating a long spec containing >{…} or @{…} — for example *{4}{>{$}c<{$}} builds four centered math-mode columns at once.
A worked example combining several
Finally, here is one column spec packing in the tools above. Column 1 is a bold label column (>{\bfseries}l); column 2 is a flush-left wrapping paragraph column (>{\raggedright\arraybackslash}p{5cm} — not strictly required here since it is not the last column, but \arraybackslash is added as a matter of habit); columns 3 and 4 are centered math-mode columns built together with *{2}{…}; and the outer padding is trimmed with @{} at both ends.
\usepackage{array}
% ...
\begin{tabular}{@{} >{\bfseries}l >{\raggedright\arraybackslash}p{5cm} *{2}{c} @{}}
\hline
記号 & 意味 & 値 & 単位 \\
\hline
$c$ & 真空中の光速。物理定数のひとつ。 & $2.998\times10^{8}$ & m/s \\
$g$ & 標準重力加速度。地表付近での近似値。 & $9.807$ & m/s$^2$ \\
\hline
\end{tabular}The result: the symbol column is uniformly bold, the meaning column wraps flush-left at 5cm, the two value columns sit centered, and the whole table aligns flush with the body’s left edge with no outer padding. Packing several mechanisms into one spec is the strength of the column language — but it can get hard to read, so for a combination you use often, give it a name with \newcolumntype{yourletter}{…} as a custom column type, and reuse it tersely as in {C C C} (an array package feature).
For aligning numbers on the decimal point, by the way, the modern and reliable choice is the **S column from the siunitx package** rather than the @{.} shown here. The S column parses each number and aligns the integer part, decimal point, fractional part, exponent, and even uncertainties correctly, and tidies digit grouping and significant figures. See it together with the “Wide tables & auto-width” page.