# Mismatched Height in Table Due to Image

I am making a table with a geometry proof that contains an image

I need four lines on the in the area of the table across from the image, but the image only takes up one line of code. Because of this, there is a bunch of empty space below the image that messes up the alignment. I have a hard time describing it, but it is immediately obvious when the code is compiled. Perhaps the lines with the figure shouldn't be in the table?

Thanks!

CODE:

\documentclass[12 pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tabular}{| l | l |}
\hline
\begin{tikzpicture}[scale=2]
\draw (0,0)  -- (1,1) -- (2,0) -- (0,0);
\draw (1,1) -- (1,0);
\end{tikzpicture} & Given \\
& $AB \cong CB$ \\
& $DA \cong DC$ \\[12pt]
& Prove: $\bigtriangleup DAB \cong \bigtriangleup DCB$ \\
\hline
Statement & Reasons \\
\hline
1. $AB \simeq CD, DA \simeq DC$ & 1. \\[12 pt]
\hline
2. $BD \simeq BD$ & 2. \\[12 pt]
\hline
\end{tabular}
\\
\end{document}

-

## 2 Answers

You can use \multirow{<number of rows>}{<width>}{<content>} from the multirow package to have <content> span several cells vertically.

Notes:

• Specifying the width as * means "use the natural width of the content".
• While the image actually span four lines, I specified five. This is because of the extra space you added after the third line.

\documentclass[12 pt]{article}
\usepackage{tikz}
\usepackage{multirow}
\begin{document}
\begin{tabular}{| l | l |}
\hline
\multirow{5}{*}{%
\begin{tikzpicture}[scale=2]
\draw (0,0)  -- (1,1) -- (2,0) -- (0,0);
\draw (1,1) -- (1,0);
\end{tikzpicture}} & Given \\
& $AB \cong CB$ \\
& $DA \cong DC$ \\[12pt]
& Prove: $\bigtriangleup DAB \cong \bigtriangleup DCB$ \\
\hline
Statement & Reasons \\
\hline
1. $AB \simeq CD, DA \simeq DC$ & 1. \\[12 pt]
\hline
2. $BD \simeq BD$ & 2. \\[12 pt]
\hline
\end{tabular}
\end{document}

-
This is an easy and elegant solution. Thank you! –  Phil Braun Jan 23 '13 at 11:55

If these exercises follow this common pattern, you may want to try the following:

\documentclass[12pt]{article}

\usepackage{booktabs,tikz}

\newcounter{geometrytest}
\newenvironment{geometrytest}
{\begin{center}
\setcounter{geometrytest}{0}
\tabular{ll}\toprule}
{\bottomrule\endtabular\end{center}}
\newcommand{\drawing}{\tabular{@{}c@{}}}
\newcommand{\given}{\endtabular&\tabular{@{}l@{}}Given:\\}
\newcommand{\prove}{\\[12pt]Prove:\\}
\newcommand{\statements}[1][4cm]{\endtabular\\\midrule[\heavyrulewidth]
Statement & \makebox[#1][l]{Reasons} \\\midrule}
\newcommand{\statement}[2][12pt]{\stepcounter{geometrytest}%
\thegeometrytest. #2 & \thegeometrytest. \\[#1]}

\usepackage{tikz}
\begin{document}
\begin{geometrytest}
\drawing

\begin{tikzpicture}[scale=2]
\draw (0,0)  -- (1,1) -- (2,0) -- (0,0);
\draw (1,1) -- (1,0);
\end{tikzpicture}

\given
$AB \cong CB$ \\
$DA \cong DC$

\prove
$\bigtriangleup DAB \cong \bigtriangleup DCB$

\statements[8cm]
\statement{$AB \simeq CD, DA \simeq DC$}
\statement[24pt]{$BD \simeq BD$}
\end{geometrytest}
\end{document}


The various parts are introduced by a command:

• \drawing for the figure; any box can go here, even something external inserted with \includegraphics;

• \given introduces the hypotheses;

• \prove introduces the assertion to be proved;

• \statements introduces the part where some statements are made, with space for the reasons; it has an optional argument for adjusting the horizontal size reserved for the reasons;

• each separate statement is the argument to a \statement command, which takes as optional argument the additional vertical spacing.

-