LaTeX.org

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

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

Vertical Alignment for Table Cell Content

Post by drmath » Sun Jul 07, 2013 9:38 am

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

\begin<|m|m|m|>\hline a & b & c \\[2cm] \hline d & e & f \\[2cm] \hline \end

Recommended reading 2024:

LaTeX Beginner LaTeX Cookbook LaTeX TikZ graphics

localghost Site Moderator Posts: 9201 Joined: Fri Feb 02, 2007 12:06 pm

Vertical Alignment for Table Cell Content

Post by localghost » Sun Jul 07, 2013 11:00 am

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

Stefan Kottwitz Site Admin Posts: 10213 Joined: Mon Mar 10, 2008 9:44 pm

Vertical Alignment for Table Cell Content

Post by 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:

\documentclass \usepackage \begin \begin<|m|m|m|@<>m@<>>\hline a & b & c & \\[2cm] \hline d & e & f & \\[2cm] \hline \end \end

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.