Graphics, Figures & TablesVertical alignment in row with a figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
luc4
Posts: 13
Joined: Thu Apr 09, 2009 12:43 pm

Vertical alignment in row with a figure

Post by luc4 »

Hi! I have a row of a table where a cell contains a figure. I would like the content to be vertical aligned. Is this possible? I tried many ways but none is working:

Code: Select all

\begin{tabular}{|c|c|c|}
\hline 
aaaaa & \includegraphics[height=1cm]{unipd} & bbbbb\tabularnewline
\hline
\end{tabular}
Is there anyone who can help me? Thanks!

Recommended reading 2024:

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

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

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

Re: Vertical alignment in row with a figure

Post by Stefan Kottwitz »

Hi,

for vertical alignment you could use \parbox inside the table cells, \parbox supports vertical positioning parameters like t or b for top or bottom alignment.

Stefan
LaTeX.org admin
luc4
Posts: 13
Joined: Thu Apr 09, 2009 12:43 pm

Vertical alignment in row with a figure

Post by luc4 »

Thanks for your answer! Unfortunately I wasn't able to use that \parbox, but I found a different solution. I created a new command:

Code: Select all

\newcommand\centerAlign[1]{%
  \raisebox{-0.5\height}{#1}%
}
and then used it to center align contents of the cells. Seems to work just fine. Thanks!
Post Reply