LaTeX forum ⇒ Graphics, Figures & TablesVertical Alignment for Table Cell Content

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

Vertical Alignment for Table Cell Content

Postby drmath » Sun Jul 07, 2013 9:38 am


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

  1. \begin{tabular}{|m{5cm}|m{5cm}|m{5cm}|}\hline
  2. a & b & c \\[2cm] \hline
  3. d & e & f \\[2cm] \hline
  4. \end{tabular}

Please help.


User avatar
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Jul 07, 2013 11:00 am

For an adequate problem description kindly prepare (again) a self-contained and minimal example.

LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9521
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Jul 10, 2013 10:14 am

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:

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

Next time, in case of problems, it would be good to provide a Infominimal 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.

Site admin

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: rahulchoudhary and 2 guests