LaTeX has no true “merge cells” operation. Read latex.ltx and you find that the horizontal one, \multicolumn, begins with \multispan, which is TeX’s primitive \omit — an instruction to throw away the column template for this cell. It does not glue neighbours together; it ignores the declared pattern and claims its own width. The vertical one, \multirow, is bolder still: it merely sets text in a box tall enough to hang down over the rows beneath. Those two implementations explain almost every stumble on this page, from the error ! Misplaced \omit. to text printed on top of the row below. Along the way we look at the genuinely awkward part — ruling under a spanned cell with \cline and \cmidrule.
Merging across columns — \multicolumn, and why it must start a cell
The form is the three-argument \multicolumn{n}{spec}{text}: n is the number of columns to span, spec is the column specification of the single cell that results, and text is its contents. It is built into standard LaTeX, so no package is needed. The crucial point is that spec describes one merged column and does not inherit the original n specifications — so write exactly one of l, c or r. Write two, as in \multicolumn{2}{cc}{…}, and it breaks with ! Missing \endgroup inserted. followed by ! Extra alignment tab has been changed to \cr.. Conversely spec may carry a vertical rule | or an @{…}, which override the rules and the inter-column space for this merged cell alone.
\multicolumn must be the very first thing in a cell. Call it after something else, as in X \multicolumn{1}{c}{Y} & Z, and you get ! Misplaced \omit.. As noted at the top, \multicolumn really is \omit, the primitive that declares “do not use this cell’s template” — and a declaration like that can only mean something before the cell has begun. That is why the error arrives under the name \omit rather than \multicolumn.
\begin{tabular}{lcc}
\hline
\multicolumn{3}{c}{Sales summary} \\
\hline
Item & H1 & H2 \\
\hline
Domestic & 120 & 145 \\
Overseas & 80 & 96 \\
\hline
\end{tabular}The first row folds what would be three columns into one centred cell with \multicolumn{3}{c}{Sales summary}, 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; here \multicolumn{3}{…} accounts for all three, so no & is needed. Also worth remembering is the idiom of setting n to 1. It spans nothing, but it can override the alignment of that one cell or drop the vertical rule | at that position. To centre just the header of a numeric (r) column, write \multicolumn{1}{c}{Header}; to suppress the rule for a single cell in a boxed table, simply leave | out of spec.
When two \multicolumn cells sit side by side in a boxed table, write the vertical rule in only one of them. Follow \multicolumn{2}{|c|}{left} with \multicolumn{2}{|c|}{right} and two rules are drawn on top of each other at the boundary, so that one rule looks noticeably heavier than the rest — increase \arrayrulewidth and it becomes obvious. The correct form drops the leading bar from the second: \multicolumn{2}{c|}{right}. This is a side effect of the plain implementation — \multicolumn draws exactly what you wrote in place of the template it discarded, and it does not tidy up duplicates.
Merging across rows — the multirow package and its arguments
A cell spanning rows cannot be made with a standard command; you load the multirow package (TeX Live 2024 ships v2.8 of 15 March 2021). Forget it and you simply get ! Undefined control sequence.. The full form has six slots — \multirow[vpos]{nrows}[bigstruts]{width}[vmove]{text} — of which only nrows, width and text are mandatory: the number of rows to span, the width of the cell, and its contents. Pass * as the width and the text is set at its natural width, which makes \multirow{3}{*}{Label} the most straightforward form.
The decisive rule is to leave the cells below it empty. Put \multirow in the top row and, in the following rows, pass over that column with nothing but &. In the official documentation’s words: leave the other rows empty at this column, “otherwise the stuff created by \multirow will over-write it.” Write real content there and there is no error at all — the two texts are simply printed on top of one another. nrows may also be negative: a positive value spans “this row and the n−1 rows below”, a negative one “this row and the |n|−1 rows above”, covering the same number of rows either way — the difference is only whether you write the command in the top row or the bottom one. Fractional values are allowed too, so \multirow{2.5}{*}{…} can fine-tune the height.
\usepackage{multirow}
% ...
\begin{tabular}{|l|l|c|}
\hline
\multirow{2}{*}{Fruit} & Apple & 380 \\
& Orange & 120 \\
\hline
\multirow{2}{*}{Vegetable} & Carrot & 90 \\
& Radish & 150 \\
\hline
\end{tabular}| Argument | Role | Notes |
|---|---|---|
[vpos] | Vertical alignment (optional, first) | Default c; also t / b |
nrows | Rows to span (required) | Positive spans down, negative up; fractions allowed |
[bigstruts] | Number of bigstrut uses spanned (optional) | Default 0; prefix t / b / tb for finer control |
width | Cell width (required) | * natural width, = the column width, a length gives a parbox |
[vmove] | Position fine-tune (optional, before text) | Positive raises, negative lowers |
\multirowsetup | A hook expanded just before text | Initially \raggedright; change it with renewcommand |
Give width an absolute length instead of * — \multirow{2}{4em}{…} — and the contents are set as a parbox of that width, so a long label wraps. In that form you may notice the text comes out flush left rather than justified. That is not a bug but the design: the hook \multirowsetup, expanded just before text, initially contains \raggedright. To centre it instead, write \renewcommand{\multirowsetup}{\centering}. And width accepts one more value, =, meaning “use the width defined for the column this entry sits in” — handy inside a p{} column or a tabularx X column, but in a column with no defined width it produces a strangely wide result.
\multirow does not reserve space — when the text hangs into the next rows
This is the most famous accident with \multirow. It does not make the table reserve the vertical space it needs. The height of its box is only estimated from nrows and bigstruts, because it does not know the real heights of the rows. So when the contents make a tall box, they simply hang out over the rows below or past the bottom of the table. The official documentation says so frankly, illustrating with a table of drug side effects in which two \multirow entries “are too high; the first sticks out into the second entry, and the second one sticks out of the table.” The symptom appears whenever nrows is too small for the amount of content.
There are three fixes, the first two of which the official documentation gives. First, add empty rows to cover the overlap — write as many & & \\ lines as you are short of. This is the surest route and only requires counting rows. Second, stretch the rows themselves — put a zero-width strut such as \newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}} into each row to buy height. (You can instead use \bigstrut from the bigstrut package and declare how many you spanned in [bigstruts].) Third, declare a larger nrows than is literally true, possibly a fractional one — the quickest, but it easily throws off the relationship with the rules, so keep it as a last resort.
\usepackage{multirow}
% ...
% the label wraps to four lines but the block has only two rows,
% so raise nrows to 4 and add two empty rows to cover the overlap
\begin{tabular}{|l|c|}
\hline
\multirow{4}{4em}{A long label that wraps} & one \\
& two \\
& \\
& \\
\hline
next & row \\
\hline
\end{tabular}The same weakness — not knowing the row heights — also shows up when some row elsewhere in the table is unusually tall. The documentation’s example is a table whose third row wraps in a p{4cm} column, so that \multirow{3}*{Week 38} ends up above the visual centre of the block. When the rows are not of equal height, the centre \multirow estimated and the centre your eye sees do not agree. Such misalignment is corrected by hand with a small [vmove]. Using a relative unit like .1ex gives the correction a reasonable chance of surviving a later change of body type size — that advice, too, is from the official documentation.
When a rule meets a spanned cell — use \cline and \cmidrule, not \hline
This is the awkward part of the whole topic. Write \hline between rows that a \multirow spans and the rule is drawn straight through the text of the merged cell — the label looks struck through, because \hline merely lays an \hrule the full width of the table between two rows and knows nothing about what sits on top of it. Thicken \arrayrulewidth and you can plainly see the letters skewered by the line. The remedy is simple: leave that column out of the rule — with a column range, \cline{2-3} in standard LaTeX, or \cmidrule{2-3} if you use booktabs.
\usepackage{multirow}
% ...
% \hline here would draw straight through the word "Group";
% \cline{2-3} spares column 1
\begin{tabular}{|l|l|c|}
\hline
\multirow{2}{*}{Group} & alpha & 1 \\
\cline{2-3}
& beta & 2 \\
\hline
\end{tabular}\cline and \cmidrule both take a column range, but they have different characters. \cline{i-j} is \arrayrulewidth thick (0.4pt by default) and runs exactly from edge to edge of the given columns, so two adjacent \cline rules join up and read as one. The booktabs \cmidrule{i-j} is thinner — \cmidrulewidth, 0.03em by default, about 0.3pt at 10pt body type — and takes \aboverulesep and \belowrulesep of space above and below. More importantly in practice, a parenthesised optional argument trims its ends: \cmidrule(lr){2-3} shortens it on both sides so that a gap opens between it and the next \cmidrule and the two read as separate rules — the standard treatment when several header groups sit side by side.
\usepackage{booktabs}
% ...
% two \multicolumn headers, each underlined by its own trimmed rule
\begin{tabular}{lcccc}
\toprule
& \multicolumn{2}{c}{2024} & \multicolumn{2}{c}{2025} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
Item & Q1 & Q2 & Q1 & Q2 \\
\midrule
Apple & 1 & 2 & 3 & 4 \\
\bottomrule
\end{tabular}This is the standard working shape for combining \multicolumn with rules. \multicolumn{2}{c}{2024} makes a heading over two columns, and the \cmidrule(lr){2-3} directly beneath says “these two belong together.” Drop the (lr) and the two rules join up, hiding the boundary between the groups. If you genuinely want two \cmidrule rules stacked over the same column range, put booktabs’s \morecmidrules between them — written plainly, two in a row are treated as belonging on the same rule row. In coloured tables a \cline can vanish under the background panel; that symptom and the hhline workaround are covered on the “Colouring a table” page.
Merging a rectangular block — \multirow goes inside \multicolumn
A rectangular block spanning both directions is made by combining \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 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. And the \multirow rule still applies here — the same position in the rows below keeps the shape of the \multicolumn but is left empty of content.
\usepackage{multirow}
% ...
\begin{tabular}{|l|l|c|}
\hline
\multicolumn{2}{|c|}{\multirow{2}{*}{Region and class}} & Count \\
\multicolumn{2}{|c|}{} & \\
\hline
East & Kanto & 12 \\
\cline{1-3}
West & Kansai & 9 \\
\hline
\end{tabular}Breaking lines inside one cell is not merging — makecell
One distinction is worth drawing. Wanting a single cell to break onto several lines is not a merge at all. Since l, c and r columns do not wrap, it is tempting to write \\ directly inside a cell — but doing so silently breaks the table without an error: given A & B\\C \\, TeX reads the \\ as an end of row and sets C as the first cell of the next row. The absence of an error makes this the more troublesome failure. When you simply want a short string to break where you choose, \makecell{…} from the makecell package is the easiest tool.
\makecell{line1\\line2} sets its contents as a small one-column tabular, which is what makes \\ usable there as a forced line break. An optional argument sets the alignment — \makecell[l]{…} for flush left, \makecell[t]{…} for top — passing one letter each for vertical and horizontal alignment (both centred by default). For column headings there is also \thead{…}, which carries a common font and spacing. When the content is long and you want it to wrap automatically to a width, the proper route is a p{width} column, or array’s m{width} for vertical centring, not \makecell.
\usepackage{makecell}
% ...
\begin{tabular}{lc}
\hline
\thead{Item} & \thead{Year on year\\(\%)} \\
\hline
Revenue & \makecell[r]{+8.2\\(record high)} \\
\hline
\end{tabular}Which tool to reach for, and when
Choosing is simple: span columns with \multicolumn, span rows with \multirow, use both for a rectangle (with \multirow on the inside), and reach for \makecell only to break lines within one cell. If you want long prose to wrap to a width, none of these is the answer — that is the job of a p{width} column. And once you have written a table containing merges, always look at the PDF and check three things: whether you forgot to empty a cell below a \multirow (is any text overprinted?), whether the \multirow box hangs out below the block (raise nrows or add an empty row), and whether a rule cuts through a merged cell (replace \hline with \cline or \cmidrule). Those three cover almost every accident that actually happens.