## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Vertical Alignment for Table Cell Content

Information and discussion about graphics, figures & tables in LaTeX documents.
drmath
Posts: 2
Joined: Wed Jun 08, 2011 3:58 am

### Vertical Alignment for Table Cell Content

Hi,

I want to align tabular cells vertically. But third column is not aligned.

\begin{tabular}{|m{5cm}|m{5cm}|m{5cm}|}\hlinea & b & c \\[2cm] \hlined & e & f \\[2cm] \hline\end{tabular}

Please help.

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
For an adequate problem description kindly prepare (again) a self-contained and minimal example.

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Stefan Kottwitz
Site Admin
Posts: 9521
Joined: Mon Mar 10, 2008 9:44 pm
All cells in a row are still vertically aligned. In each column, the \\[2cm] made the last cell larger, while the content of this cell remains on top of its cell. Inner alignment in cells is top, outer aligment (between cells) is middle, that's what m means.

You could fix it by adding an empty invisible column:

\documentclass{article}\usepackage{array}\begin{document}\begin{tabular}{|m{5cm}|m{5cm}|m{5cm}|@{}m{0cm}@{}}\hline   a & b & c & \\[2cm] \hline   d & e & f & \\[2cm] \hline\end{tabular}\end{document}

Next time, in case of problems, it would be good to provide a minimal working example which shows the problem. Such a small but complete code which I posted here. It's not always so easy for a reader to complete it himself. Note, a poster might save time to not post a complete example, but all readers then have to invest to do that themselves, if the code requires a test.

Stefan
Site admin

Return to “Graphics, Figures & Tables”

### Who is online

Users browsing this forum: rahulchoudhary and 2 guests