# tabular height savebox problem

I'd like to build a tabular and next to it a graphics in the same height.
I use the following code (for minimal working purposes, I used \rule) and do not understand, what is going wrong:

\documentclass{minimal}
\begin{document}
\newsavebox{\testbox}%
\newlength{\testheight}%
\savebox{\testbox}{%
\begin{tabular}{cr}%
\multicolumn{2}{c}{\underline{\underline{\textsc{Line 1}}}}\\ \\
Line&2\\%
Line&3\\%
Line&4\\%
\end{tabular}%
}%
\settoheight{\testheight}{\usebox{\testbox}}
\usebox{\testbox}\hfill\rule{3pt}{\the\testheight}\hfill\rule{3pt}{\the\testheight}
\end{document}


As \savebox if fragil, I also played around with the robust commands \mbox and/or \sbox - without success.

-

By default tabular is vertically centred so the height is only (roughly) half what you need.

Depending what you want to do you could use

           \begin{tabular}[b]{cr}%


so the table is bottom aligned, or you could extract the height and the depth of the box.

-
This was really fast - thanks! –  Bastian Ebeling Aug 9 '12 at 8:53
May be you can try tabulatht from the Oberdiek-bundle. The tabularht package defines some environments that add a height specification to tabular and array environments.