Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
To center text vertically in a LaTeX table cell, load the array package and use an m{width} column type; for a single cell use \makecell[c]{...}, and for a cell spanning rows use multirow, which centers by default. This guide is for researchers and analysts typesetting results tables who find that multi-line cells hug the top of the row.
What it is used for in research
Results tables often mix one-line numbers with multi-line labels, such as a wrapped variable description next to a coefficient. In a standard p{width} column the text is aligned at the top of the cell, so the numbers sit level with the first line of the label rather than the middle. Vertical centering fixes this without changing the table layout. The same techniques apply whether you write tables by hand or paste output from statistical software into a LaTeX document (see matrices in LaTeX for a related layout task).
Install or access (official source only)
All three tools are free LaTeX packages distributed through CTAN, the Comprehensive TeX Archive Network. Load what you use in the preamble:
\usepackage{array} % m{} and b{} column types
\usepackage{makecell} % makecell
\usepackage{multirow} % multirow
The package documentation is on CTAN: array (documentation version 2.7b, revised 2026/06/26 when read), makecell and multirow.
Step-by-step: center cell content vertically
Which tool fits which situation
| Situation | Use | Source |
|---|---|---|
| Every cell in a column should be vertically centered | m{width} column type (needs array) |
Overleaf Tables; array documentation |
| One multi-line cell | \makecell[c]{Line one \\ Line two} |
makecell documentation |
| A cell that spans several rows | \multirow{3}{4em}{text}; the default vertical position is [c], centered |
multirow documentation; Overleaf Tables |
| One-line cells look cramped against horizontal lines | \setlength{extrarowheight}{1pt} |
array documentation |
1. Center a whole column with m{width}
- Add
\usepackage{array}to the preamble. - Replace the column specifier with
m{width}. Overleaf documentsp{width}as top-aligned,m{width}as aligned in the middle andb{width}as aligned at the bottom, with m and b requiringarray.
\begin{tabular}{ | m{5em} | m{1cm} | m{1cm} | }
\hline
cell1 dummy text dummy text dummy text & cell2 & cell3 \\
\hline
\end{tabular}
This follows the example on the Overleaf Tables page, where m{5em} centers the text in the middle of the cell. The array documentation describes these columns as equivalent to \parbox of the given width: p corresponds to \parbox[t]{width}, with m and b as the middle and bottom variants.
2. Center horizontally as well
To center the text horizontally inside an m column, insert declarations with >{...}. Because \centering redefines the row-ending command, restore it with \arraybackslash, which the array documentation describes as restoring \\ for use in array and tabular environments after commands such as \raggedright:
\begin{tabular}{ | >{\centering\arraybackslash}m{3cm} | m{3cm} | }
3. Center one multi-line cell with makecell
The makecell package provides \makecell[alignment]{text}, where the vertical letters are t, b and c. Use \\ inside the braces for line breaks:
\makecell[c]{Line one \\ Line two}
For a cell with a predefined width, the makecell documentation shows vertical alignment through a grouped column specifier, for example [c{p{3cm}}], or a double group {{m{3cm}}} for vertical centering and {{b{3cm}}} for bottom alignment.
4. Center a cell spanning rows with multirow
Load multirow, write the spanning cell in its first row and leave the cells below it empty:
\multirow{3}{4em}{Multiple row} & cell2 & cell3 \\
& cell5 & cell6 \\
& cell8 & cell9 \\
The multirow syntax is \multirow[vpos]{nrows}[bigstruts]{width}[vmove]{text}. Its documentation states that vpos sets the vertical position of the text in the block and that the default, [c], vertically centers it, so no extra option is needed for centering.
Output and how to read it
After compiling, a correctly centered cell has equal space above and below its text within the row. Check three things:
- Row height. Per the array documentation, m-cells are supposed to be vertically centered within the table row. If numbers still look tight against a rule, add
extrarowheight, a positive length added to the normal height of every row (depth unchanged); the documentation example is\setlength{extrarowheight}{1pt}. The documentation also notes that m-cells position their content manually, soextrarowheightis ignored during their vertical alignment. - The t and b option on tabular is not cell centering. The optional position argument of
tabularplaces the whole table relative to the surrounding text baseline. By default the environment is centered on that baseline. It does not align text inside cells. - Horizontal alignment. Vertical centering does not center the text horizontally; use step 2 for that.
Troubleshooting
- LaTeX does not accept the m column type. Overleaf notes that
mandbrequire thearraypackage; confirm\usepackage{array}is in the preamble. - Row endings break after adding centering in a column. Add
\arraybackslashafter it, as in step 2, so\\still ends the row. - multirow or makecell is undefined. Load
multirowormakecellin the preamble; they are separate packages fromarray. - Spacing from
\\[...]looks different. Per the array documentation, since version 2.4f the optional-argument space of\\is added after centering.
Free alternatives (all are CTAN packages)
| Package | Vertical centering mechanism | Applies to |
|---|---|---|
array |
m{width} column type |
Whole columns of fixed width |
makecell |
\makecell[c]{...} |
Individual multi-line cells |
multirow |
multirow with default [c] |
Cells spanning several rows |
For related layout questions, see centering in LaTeX, spacing in LaTeX and including graphics in LaTeX.
FAQ
How do I vertically center text in a LaTeX table cell?
Load array and declare the column as m{width}. For one cell, use \makecell[c]{...}.
What is the difference between p, m and b columns?
Per Overleaf, p{width} aligns text at the top of the cell, m{width} in the middle and b{width} at the bottom; m and b need the array package.
Does multirow center vertically?
Yes. Its documentation says the default [c] vertically centers the text in the multirow block.
Does the position option on tabular center cell content?
No. The tabular position argument positions the whole table relative to the surrounding baseline.
Sources (official documentation)
- Overleaf, Tables, read 2026-11-08.
- CTAN, array package documentation v2.7b (revised 2026/06/26), read 2026-11-08.
- CTAN, makecell documentation V0.1e (2009/08/03), read 2026-11-08.
- CTAN, multirow documentation, read 2026-11-08.







