GeneralControlling the vertical align of contents in table cell?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Controlling the vertical align of contents in table cell?

Post by benowar »

Hi,

is there any way to vertically align the contents of a table cell? I have a table with 2 columns. The content in the second column is big enough to cause line wrapping. Now, the content of the first column is just a single word and it gets centered vertically. What I would like is the content of the first column to align on top of the cell and not the center.

The code I use for the table is:

\begin{tabular}{ m{.25\textwidth}@{\extracolsep{5mm}} m{.60\textwidth} }

Thanks,
Ben

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Controlling the vertical align of contents in table cell?

Post by localghost »

It would be good to have a minimum working example (MWE) to figure out what's going wrong.
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Controlling the vertical align of contents in table cell?

Post by balfonsi »

Just use p{0.25\textwidth} instead of m{0.25\textwidth} (cf doc for the array package).

B.A.
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Controlling the vertical align of contents in table cell?

Post by benowar »

Awesome, using "p" did the trick!

Thanks,
Ben
Post Reply