[Tex/LaTex] Align text and image in table

graphicstablesvertical alignment

My table looks like this:

table

The left column will contain words, like it is now, and in the right column I want to add these small pictures (some are a bit bigger than this one) in every row.

I have two problems however, as can be seen from the image linked:

  1. how do I center the text of the first column properly? Tight now it is a bit pushed to the bottom of the field.

  2. how do i center the image in the field? Right now it is pushed against the top wall of the table.

My code looks like this:

\begin{table}[h]
\centering
\begin{tabular}{l|l}
\textbf{Verb}   & \textbf{Example}   \\ \hline
``goes-to''         & \includegraphics[scale=1]{images/appendix/B/1.png} \\ \hline
``walks-to''        &     \\ \hline
``says to''         &        \\ \hline
``chats to''        &              
\end{tabular}
\caption{My caption}
\label{my-label}
\end{table}

Best Answer

Here is a solution with some vertical padding. The cellspace package is done for that: it defines a minimal vertical spacing at the top and the bottom of cells in columns with a specifier prefixed with S. With the makecell package, you can have line breaks in cells, thus allowing for several aimges in a single cell:

\documentclass{article}
\usepackage{cellspace, graphicx, makecell}
\renewcommand\cellspacetoplimit{3pt}
\renewcommand\cellspacebottomlimit{3pt}
\newcommand\rowincludegraphics[2][]{\raisebox{-0.45\height}{\includegraphics[#1]{#2}}}
\begin{document}
\begin{table}[h]
  \centering
  \begin{tabular}{c|Sl}
    \textbf{Verb} & \textbf{Example} \\ \hline
    ``goes-to'' & \rowincludegraphics[scale=0.1]{loupnorstein2} \\ \hline
    ``walks-to'' & \rowincludegraphics[scale=0.1]{loupnorstein2} \\ \hline
    ``says to'' & \rowincludegraphics[scale=0.1]{loupnorstein2} \\ \hline
    ``chats to'' & \makecell{\rowincludegraphics[scale=0.1]{loupnorstein2}\\[3.8ex]\rowincludegraphics[scale=0.1]{loupnorstein2}}
  \end{tabular}
  \caption{My caption}
  \label{my-label}
\end{table}
\end{document} 

enter image description here

Related Question