How to Handle Blank Lines in a LaTeX tabular Environment
At a glance
- 1. Remove blank lines
Do not put an empty source line between table rows; it creates a paragraph break inside the alignment.
- 2. End each row
Separate cells with ampersands and finish each row with a double backslash.
- 3. Add vertical space
Use an optional row-space amount or a table-spacing command when you want a visible gap.
- 4. Check cell types
Use a p-column or a paragraph box when a cell needs multiple paragraphs.
A blank line in the source code is not an empty table row. Inside tabular, it creates a paragraph break, which is generally not allowed in the usual l, c, and r cells. Depending on the surrounding commands, LaTeX may report an error such as “Something’s wrong—perhaps a missing \item” or another alignment-related error.
The fix is to remove blank lines between rows. If you want a visual gap, add vertical space explicitly. If you want a cell to contain separate paragraphs, give it a paragraph-style column or put the text in a paragraph box.
Separate rows and cells correctly
In a tabular environment, & separates columns and \\ ends a row. A typical table is written with consecutive row commands and no blank source lines between them:
\begin{tabular}{lr}
Item & Count \\
Apples & 3 \\
Pears & 5 \\
\end{tabular}
A blank line between Apples and Pears would insert a \par token in the alignment. It does not tell LaTeX to start an empty row. Remove that blank line instead.
Blank lines before or after the entire tabular environment are fine when they occur in ordinary document text. The restriction concerns paragraph breaks inside the alignment.
Add a gap between rows
If the purpose of the blank line is to make the table easier to read, add spacing as part of the row ending. For example, \\[6pt] ends the row and adds 6 points of extra vertical space after it:
\begin{tabular}{lr}
Item & Count \\
Apples & 3 \\[6pt]
Pears & 5 \\
\end{tabular}
For tables using the booktabs package, \addlinespace is another option. It inserts extra space between rows without adding a blank row. Avoid using repeated empty rows just to create spacing; they can make rules and row alignment harder to manage.
Worked example with multirow cells
A cell created with \multirow still belongs to a regular table row. Leave the cell empty in the following row where the multirow text spans, but do not insert a blank source line. This complete example uses booktabs for rules and multirow for the spanning labels:
\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\begin{document}
\begin{tabular}{llr}
\toprule
Group & Item & Count \\
\midrule
\multirow{2}{*}{Group A} & First & 3 \\
& Second & 5 \\[6pt]
\multirow{2}{*}{Group B} & Third & 2 \\
& Fourth & 4 \\
\bottomrule
\end{tabular}
\end{document}
The second row of each group begins with & because the first column is occupied by the label that spans both rows. The \\[6pt] after Second separates the groups visually. There are no blank lines within the tabular alignment. The needed packages are booktabs and multirow.
When a cell needs a paragraph break
Ordinary l, c, and r columns are intended for one-line cell contents. For text that wraps or has multiple paragraphs, define a p{...} column with a width, or use a \parbox or \minipage inside the cell. For example:
\begin{tabular}{p{4cm}r}
Description & Count \\
First paragraph.\par Second paragraph. & 2 \\
\end{tabular}
A p column is paragraph-formatted, so paragraph breaks within its cell are supported. This is different from placing a blank line between table rows: that still breaks the alignment and should be avoided.
Common mistakes
- Using a blank line as a separator: It inserts a paragraph break. Delete it, or use a spacing command.
- Forgetting
\\at the end of a row: A single newline in the source does not end a table row. Use the row terminator explicitly. - Adding
&for a visual gap:&starts another cell. Use row spacing instead if you want more vertical separation. - Expecting
\multirowto create the other rows: It only spans rows that you still need to write. Leave the spanning column empty in those rows, but keep the row structure and terminators intact.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.