Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to create a table where I control the height of the cells and wish to vertically center all the cells. At first sight, the issue here might look quite similar to Problem with Table Vertical Alignment but the solution proposed there doesn't fit my problem.

A minimal example is given below. The issue is that the two first columns are correctly centered but not the last one.

\begin{tabular}{ |m{2cm}|m{2cm}|m{2cm}|}
   \hline
     x &
     x &
     x \\[5mm]
   \hline
\end{tabular}

Does anyone understand what is wrong here ? Any pointers would be greatly appreciated.

share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Jan 21 '13 at 13:59
add comment

1 Answer

up vote 3 down vote accepted

Please always post complete documents showing all packages used (I happen to notice array package usage here but you didn't mention it as a requirement/)

Easiest workaround is to have an extra unused column that takes the \\ spacing:

But note that the argument to \\ doesn't add that amount of extra space, it just increases the standard strut depth by that amount so it doesn't have any effect unless the strut is deeper than the depth of the m entries.

\begin{tabular}{ |m{2cm}|m{2cm}|m{2cm}|@{}l@{}}
   \hline
     x &
     x &
     x &\\[5mm]
   \hline
\end{tabular}
share|improve this answer
    
Thanks for the fast answer. Your solution does exactly what I wanted to do. –  ed82 Jan 21 '13 at 14:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.