# Table layout problem

I have a problem with a table. Since I am a day zero newbie in latex, please bare with me.

This is what I did:

\begin{table}[h]
\begin{tabular}{|l|p{0.5\textwidth}|}
\hline
\includegraphics[width=0.48\textwidth]{Constraints/FacesX.png}
&
\\
\hline
\end{tabular}
\end{table}


I added the \hline and | so I can see what is happening, but I do not need them.

This is what I get:

dsadasd is at the bottom of the cell instead of at the top. What am I doing wrong?

-
My gut reaction is "why are you using a table", but it might be justified. – You Jun 18 '12 at 15:27

The reason is, that the picture is is not aligned at the top. So you may use the following approach to create a point, where the stuff can be aligned:

\documentclass{article}
\usepackage{graphicx}

\newcommand{\BildTop}[1]{\vtop{\null\hbox{#1}}}

\begin{document}
\begin{tabular}{lp{0.5\textwidth}}
\end{tabular}
\end{document}


The macro \BildTop creates a vertical box (\vbox) with nothing in it (\null) in the first line and the other material e.g. your picture in the second line (\hbox{#1})

-
Thanks! That solved my problem. – BCartolo Jun 18 '12 at 15:54
a p column is already a vtop internally so actually you just need a \null (or \vspace{0pt} before the \includegrapics. – David Carlisle Jun 18 '12 at 15:59

Use the package adjustbox, which adds many facilities for managing boxes and images:

\documentclass{article}
\begin{document}
\begin{tabular}{|l|p{0.5\textwidth}|}
\hline
\includegraphics[valign=t,width=0.48\textwidth]{example-image-a}
&