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 the following table

\includegraphics{tag.png} & bla bla bla.\\
\includegraphics{tag.png} & \\
\includegraphics{tag.png} & Store project\\
\includegraphics{tag.png} & Gestures\\
\includegraphics{tag.png} & Screenshot\\
\includegraphics{tag.png} & Tagging\\

Now I'd like to achieve that the second column consumes all the remaining page width and the text should be centered vertically in the cell. I achieve either one of this but no both together. Any hints?

share|improve this question
A tip: If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "101010" on it). – lockstep Mar 11 '11 at 15:58
up vote 2 down vote accepted

\begin{tabularx}{\linewidth}{@{} l X @{}}
\makecell{\includegraphics{tag.png}} & bla bla bla.\\
\makecell{\includegraphics{tag.png}} & \\
\makecell{\includegraphics{tag.png}} & Store project\\
\makecell{\includegraphics{tag.png}} & Gestures\\
\makecell{\includegraphics{tag.png}} & Screenshot\\

share|improve this answer
@Herbert This is basically the same as my solution, except the first column has a specfied width. Why does using lX (with the same redefinition of X) not work? – Alan Munn Mar 11 '11 at 16:47
@Alan: Because l is aligned to its baseline but m is aligned to its centerline. – Martin Scharrer Mar 11 '11 at 16:51
@Herbert: Thanks i also tried your solution but then I can't generate a PDF: <pictures//tag.png, id=198, 54.9553pt x 55.70813pt> <use pictures//tag.png> <pictures//tag1.png, id=199, 53.44969pt x 54.2025pt> <use pictures//tag1.png> Underfull \hbox (badness 10000) in paragraph at lines 323--324 <use pictures//tag.png> <use pictures//tag.png> ! Extra alignment tab has been changed to \cr. <template> ...egin \relax \d@llarend \endtemplate l.332 \end{tabularx} ? – RoflcoptrException Mar 11 '11 at 16:54
@Martin I understand the difference between l and m, but why should the specification of one column (i.e. the l) affect the vertical spacing in the next column which is m? For example, if you just use tabular{lm} the text in the m column is vertically centred. – Alan Munn Mar 11 '11 at 16:58
@Roflcoptr: you have forgotten a `\\` at one tabular line or more columns used than specified. – Herbert Mar 11 '11 at 17:06

Use the tabularx package: (the vertical bars are included just to show the centering).

 \rule{1in}{1in} & This is some text. This is some more text. This is even more text.


This doesn't do exactly what you want, because it uses two X columns rather than one. For some reason that I don't understand, using


fails to make the text in the X column vertically centred.

share|improve this answer
Thanks. I just tried that but i centers horizontally not vertically. – RoflcoptrException Mar 11 '11 at 16:11
I've updated my answer. It's not exactly what you want, but it might do the job. – Alan Munn Mar 11 '11 at 16:32

Herbert's answer is correct. However, if you don't want or can't specify the width of the first column you could use the following code and have it measured automatically.



    \rule{1in}{1in} & Text \\
    \rule{1in}{2in} & Other Text Ag\strut \\
    \rule{1in}{1in} & 
    Very very very very very very very very 
    Very very very very very very very very 
    Very very very very very very very very 
    Very very very very very very very very 
    long text \\
share|improve this answer
see my edited example, it does the same with column type l – Herbert Mar 11 '11 at 18:44
Thanks @Herbert! I didn't know makecell before. – Martin Scharrer Mar 11 '11 at 18:48

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.