Combining several cells of a table into one — what people call merging cells — splits cleanly by direction and by tool. Spanning columns horizontally is the standard command **\multicolumn; spanning rows vertically is \multirow from the multirow package; and combining the two merges a rectangular block. And when you only want a single cell to break onto several lines — not a merge at all — that is the job of makecell**. This page walks through these four tools in turn, gotchas of alignment included.
Horizontal merge — \multicolumn
\multicolumn combines adjacent columns within a single row. It is built into standard LaTeX — no package needed. Its form is the three-argument \multicolumn{n}{spec}{text}: n is the number of columns to span, spec is how the resulting single cell is aligned (a one-column column spec), and text** is its contents. For example, \multicolumn{2}{c}{Header} merges two columns into one cell and centers it.
The crucial point is that **spec describes the one merged column, not a carry-over of the original n columns** — so you must write exactly one of l, c, or r. spec may also contain a **vertical rule | or @{…}, which override the rules and intercolumn spacing for this merged cell alone**. If one of two adjacent \multicolumn cells ends with | and the next begins with one, only a single rule is drawn, not two.
\begin{tabular}{lcc}
\hline
\multicolumn{3}{c}{売上集計} \\
\hline
項目 & 上期 & 下期 \\
\hline
国内 & 120 & 145 \\
海外 & 80 & 96 \\
\hline
\end{tabular}The first row here uses \multicolumn{3}{c}{Sales summary} to fold what would be three columns into one centered cell, serving as a title for the whole table. Even in a merged row, the cells of that row must still add up to the declared number of columns (3 here). Because \multicolumn{3}{…} accounts for all three, this row needs no &.
Worth remembering too is the idiom of **setting n to 1**. \multicolumn{1}{…}{…} spans no columns, but it can override the alignment of that one cell or **drop the vertical rule |** at that position. To center just the header of a numeric (r) column, write \multicolumn{1}{c}{Header}; to suppress the vertical rule for a single cell in a boxed table, write \multicolumn{1}{c}{…} with no | in the spec.
Vertical merge — multirow
A cell spanning several rows vertically cannot be made with a standard command; you load the **multirow package** (\usepackage{multirow} in the preamble). Its core is **\multirow{n}{width}{text}: n is the number of rows to span, width is the cell width, and text is the contents. Passing * as the width sets the text at its natural width** — \multirow{3}{*}{Label} is the most straightforward form.
The decisive rule is to **leave empty the cells below that \multirow spans**. Place \multirow in the top row, and in the following rows write **just & with nothing at that column position. Forget to empty them and the rows below will overprint** the text \multirow set. A positive n spans “this row and the n−1 rows below”; a negative value spans “this row and the −n−1 rows above” (per the official documentation).
\usepackage{multirow}
% ...
\begin{tabular}{|l|l|c|}
\hline
\multirow{2}{*}{果物} & りんご & 380 \\
& みかん & 120 \\
\hline
\multirow{2}{*}{野菜} & 人参 & 90 \\
& 大根 & 150 \\
\hline
\end{tabular}Here “Fruit” and “Vegetable” in column 1 each span two rows vertically. The key is that \multirow{2}{*}{Fruit} goes in the upper row, and the cell below it in column 1 is passed over with **& and nothing written**. Because width is *, the label is set at its natural width and centered vertically across the two rows.
\multirow also takes two optional arguments. The leading **[vpos]** sets vertical alignment (default centered c, top t, bottom b). The **[vmove]** after text is a length for fine-tuning that shifts the text up (or down, if negative) from where it would land. When the vertical centering looks slightly off against the rules, nudge it with a small value, as in \multirow{3}{*}[2pt]{…}. Note that giving an absolute width (e.g. \multirow{2}{4em}{…}) sets the contents as a parbox of that width, so a long label wraps.
| Argument | Role | Notes |
|---|---|---|
[vpos] | Vertical alignment (optional, leading) | Default c; also t / b |
n | Rows to span (required) | Positive spans downward, negative upward |
width | Cell width (required) | * for natural width; an absolute value wraps as a parbox |
[vmove] | Position fine-tune (optional, after text) | Positive raises, negative lowers |
Block merge — \multirow inside \multicolumn
To make a rectangular block that spans both directions, you combine \multirow and \multicolumn. The order is fixed: put **\multirow inside \multicolumn**. The official documentation gives \multicolumn{2}{c}{\multirow{3}{*}{Multi-multi}} as its example and states plainly that nesting them the other way “will not work.” Remember it as: the outer \multicolumn owns the horizontal span, the inner \multirow the vertical one.
To rule around the block, use a rule limited to a column range rather than \hline (which spans the full width), so the merged region is not cut through. The standard tool is **\cline{i-j}** (columns i through j); with booktabs it is **\cmidrule{i-j}**. By excluding the range that falls under the merged cell, you outline just the block cleanly.
\usepackage{multirow}
% ...
\begin{tabular}{|l|l|c|}
\hline
\multicolumn{2}{|c|}{\multirow{2}{*}{地域・分類}} & 件数 \\
\multicolumn{2}{|c|}{} & \\
\hline
東日本 & 関東 & 12 \\
\cline{1-3}
西日本 & 関西 & 9 \\
\hline
\end{tabular}This builds a 2-column × 2-row rectangular block in the top-left. In the first row, \multicolumn{2}{|c|}{\multirow{2}{*}{Region / class}} merges two columns and two rows, and the **second row receives the same position with an empty \multicolumn{2}{|c|}{}** (since \multirow spans the rows, the block portion of the lower row is left empty). \cline{1-3} separates the body rows, while \hline caps the block above and below.
Wrapping within one cell — makecell
One distinction is worth drawing here: wanting a single cell to break onto multiple lines is not a merge at all. Because l, c, and r columns do not wrap, writing \\ directly inside such a cell is an error. When you simply want a short string to break where you choose, the easiest tool is **\makecell{…} from the makecell package** (\usepackage{makecell}).
\makecell{line1\\line2} sets its contents as a small one-column tabular and uses \\ for a forced line break. An optional argument sets the alignment — \makecell[l]{…} (left), \makecell[t]{…} (top) — passing vertical and horizontal alignment one letter each (default is centered both ways). For column headings there is also **\thead{…}**, which carries a common font and spacing.
\usepackage{makecell}
% ...
\begin{tabular}{lc}
\hline
\thead{項目} & \thead{前年比\\(\%)} \\
\hline
売上高 & \makecell[r]{+8.2\\(過去最高)} \\
\hline
\end{tabular}Here the heading “Year-on-year (%)” is stacked over two lines with \thead{Year-on-year\\(\%)}, and the body figure is set right-aligned over two lines with \makecell[r]{+8.2\\(record high)}. Both merely break within a single cell — note that neither is merged with a neighbor. When the content is long and you want it to wrap automatically by width, the proper route is a **p{width} column** (or its relatives), not \makecell.
Alignment gotchas and choosing a tool
A summary of the common stumbles. First, vertical centering: \multirow text is centered in the row by default, but it can look slightly high or low depending on row height and rule thickness — pick t/b via [vpos], or nudge with a small [vmove]. Second, row consistency: even in a row containing \multicolumn, the & count plus merged spans must equal the declared number of columns. And third, nesting order: for a block merge, always put \multirow inside \multicolumn.
Choosing a tool is simple: **span columns with \multicolumn, span rows with \multirow, use both for a rectangle, and reach for \makecell only to break lines within one cell. To wrap long prose by width, the proper route is a p{width} column** (or array’s m{width} for vertical centering), letting it wrap automatically rather than using any of these. Column specs themselves are covered on “Column spec, alignment & width,” and tables that overflow the page on “Advanced table environments.”