6

I want vertically centered text in a simple table like this:

\documentclass{article}
\usepackage{array}
\newcolumntype{Z}{>{\centering\arraybackslash}m{0.2cm}}

\begin{document}
\begin{tabular}{|Z|Z|Z|Z|}
\hline
 4 & 3 & 2 & 1 \\
\hline
\end{tabular}

\end{document}

but the text is not vertically centered, it almost touches the upper hline. What should I do to fix this?

1 Answer 1

6

The paragraph box containing the cells is vertically centred (using \vcenter) But that isn't the same thing as centring the digits in the actual content, note that a line box is the same height whether the content is ( or 1 or .

You can add

\setlength\extrarowheight{2pt}

before the table to get a better appearance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .