[Tex/LaTex] How to align picture top left in a table

graphicstablesvertical alignment

is there a way to create a table with 2 columns,
in the left column should be some text,
in the right column should be a picture.

The problem is – to align both to the left, top corner. The image seems to be inserted as an inline object, so it pushes the text down, from the top.

                          _____________________
                         |                     |    
                         |                     |
Some text is pushed down |                     |

What i want is:

Some text is pushed down  _____________________
                         |                     |    
                         |                     |
                         |                     |

Here is the code:

\begin{tabular}{\textwidth}{ l l }
Some text & \includegraphics{images/image.png} \\
\end{tabular}

Best Answer

The adjustbox is what's needed:

\begin{tabular}{ll}
Some text & \adjustbox{valign=t}{\includegraphics[height=3cm,width=4cm]{p}}\\
...
\end{tabular}

With valign=t the picture is lowered in such a way that its final height is similar to the height of the surrounding text (the rest will stick below).

If you want that the top of the figure is on the baseline, use valign=T.

As the author of adjustbox comments, calling

\usepackage[export]{adjustbox}

the options provided by the package can go directly in the argument of \includegraphics, so

\begin{tabular}{ll}
Some text & \includegraphics[valign=T,height=3cm,width=4cm]{p}}\\
...
\end{tabular}

is good as well. Change the other options for your case.

Related Question