TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a table with two columns and one row. The first one is long and determines the overall height of the table (if need be it can be fixed to \textheight). In the second column I have two images. I would like one of them to be aligned to the top of the first column and the other to the second - an effect similar to a \vfill on a normal page - see example below.

The \vfill doesn't seem to work, presumably because the table's height is not defined when that column is set?

I have tried:

  1. Calculating the remaining space on the page using the \measurepage macro from this question and inserting this using \vspace - unfortunately this seems to produce lengths much greater than the real available space

  2. putting in a 0 width (invisible) rule of \textheight to fix the column height and then using \raisebox to move the column contents back up. (this fails miserably)

Is there another way of

Here is a minimal example

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.






\begingroup\rule{\linewidth}{0.15\textheight} \newline Some text \vfill \rule{\linewidth}{0.15\textheight}\endgroup \tabularnewline  




Here is a picture showing what I am trying to acheive. Two column table, the left one determines the overall height. The two images on the right should be aligned with the top and bottom of the content of the left column. There will be some text between these images in the right column, of variable length.

So far I can get the images either bottom aligned or top aligned, but not one at the top and one at the bottom.

This is what I wantto acheive

share|improve this question
I don't have lyx installed (unable to compile). However I would try using the minipage environment. Then you can use \vspace* – R. Schumacher Mar 26 '12 at 14:20
It is a bit unclear what you want to achieve. Could you make a picture? (Measuring the page is certainly not the way to go). – Ulrike Fischer Mar 26 '12 at 14:24
up vote 6 down vote accepted

It seems simpler to do this without a tabular environment and just use the minipage environment. Below I used the showframe package to display the location of the margins:

enter image description here



\includegraphics[height=\DesiredHeight, width=0.8\textwidth]{leftImage}
Some text and some more text.
share|improve this answer
Excellent, thank you. Works perfectly. You don't know how many hours I spent trying to make this work... – user8786 Mar 26 '12 at 19:47

\begin{tabularx}{\linewidth}{@{} X | p{0.2\linewidth} @{} }
\rule{\linewidth}{0.15\textheight} \\
Some text \par\vfill 
\rule{\linewidth}{0.15\textheight}} \tabularnewline  


enter image description here

share|improve this answer
Hi Herbert, This is great. There is a small difference in alignment between the small and big rules though, presumably due to "padding" inside the parbox? Is there a variable for that space that I can include into the calculation of the parbox dimensions? – user8786 Mar 26 '12 at 19:38
@user8786: see my edit (%%%%). It is a hack, because I have no real time for a closer look. – Herbert Mar 26 '12 at 19:57
Thanks. I worked out that putting the contents of the first column in a parbox as well sorts it so they have identical spacing. – user8786 Mar 26 '12 at 20:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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