# Vertically center image with respect to longtable paragraph

I have a longtable with some longer text in one column and an image in another column. I need the image to be vertically centered. How can I achieve this?

\documentclass{article}

\usepackage{mwe} % blindtext, example image
\usepackage{longtable}
\usepackage{array} % for m column type

\begin{document}

\begin{longtable}{|p{5cm}|m{2cm}|}
\blindtext &
\includegraphics[width=\linewidth]{example-image-a}
\end{longtable}

\end{document}


\documentclass{article}

\usepackage{mwe} % blindtext, example image
\usepackage{longtable}
\usepackage{array} % for m column type

\begin{document}

\begin{longtable}{|m{5cm}|p{2cm}|}% <-- changed
\blindtext &
\includegraphics[width=\linewidth]{example-image-a}
\end{longtable}

\end{document}

• This is great, thanks! Can you please explain why it works? I thought m was supposed to center cells... Aug 29 '17 at 5:36
• yes, but to baseline of cells in neighborhood colums. so in your case the baseline of the first cell (p type) was on the top ... i only move it to vertical center (m type). Aug 29 '17 at 5:46