2

I need a table with 2 rows and 4 columns. The 1st column should contain an image, which uses both rows (centered). How?

The closest I can make is this:

\begin{tabular}{ | c | l | r | r |}
 \hline
   \raisebox{-1.4cm}[0.1cm][1.5cm]{\includegraphics[height=1.6cm]{xxxxx.png}} &
    \vtop{
    \hbox{\strut top line}
    \hbox{\strut botline}
    } & 
    \vtop{
    \hbox{\strut top line}
    \hbox{\strut botline}
    } & 
    \vtop{
    \hbox{\strut top line}
    \hbox{\strut botline}
    } \\
 \hline
 \end{tabular}

This way the text does not respect the alignment, i.e text on the right column should be aligned to the right.

Also, I have to reach this numbers ({-1.4cm}[0.1cm][1.5cm]) by trial and error.

  • 1
    just take the image out of the table \raisebox{-.5\height}{\includegraphics{.}}\begin{tabular}{lrr}.... – David Carlisle Jun 29 '15 at 17:47
2

Use tabular in a better way:

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{tabular}{|c|l|r|r|}
\hline
\raisebox{-.7\height}[0pt][0pt]{\includegraphics[height=1.8\normalbaselineskip]{duck}}
& 1111   & 1111   & 111111 \\
\cline{2-4}
& 222222 & 222222 & 2222   \\
\hline
\end{tabular}

\end{document}

enter image description here

Two versions with booktabs and no vertical rule.

\documentclass{article}

\usepackage{graphicx,booktabs}

\begin{document}

\begin{tabular}{c l r r}
\toprule
\raisebox{-.7\height}[0pt][0pt]{\includegraphics[height=1.8\normalbaselineskip]{duck}}
& 1111   & 1111   & 111111 \\
\cmidrule[\lightrulewidth]{2-4}
& 222222 & 222222 & 2222   \\
\bottomrule
\end{tabular}

\bigskip

\begin{tabular}{c l r r}
\toprule
\raisebox{-.6\height}[0pt][0pt]{\includegraphics[height=1.8\normalbaselineskip]{duck}}
& 1111   & 1111   & 111111 \\
& 222222 & 222222 & 2222   \\
\bottomrule
\end{tabular}

\end{document}

enter image description here

  • What the duck? Is "duck" a ready to use image included in modern LaTeX systems? ;-) – Gonzalo Medina Jun 29 '15 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.