[texhax] A table with both images and text (format problem)

Lars Madsen daleif at imf.au.dk
Sun Jun 12 17:16:53 CEST 2005


>>
>> use the array-package
>>
>> and m{...} instead of p{...}
>>
>> I remembered wrong.
>>
>> p{...} is like \parbox[t]{...}{...}
>> m{...} is like \parbox[c]{...}{...}
>> and
>> b{...} is like \parbox[b]{...}{...}
>
>

>
> The resulting table still has too much white space (unnecessary white
> space). Is this just on my system?
>
>
> I tried using the parbox equivelents that you suggested (wrapped around
> the "\rule{5cm}{2cm}" command only, but the results are the same as the
> above, i.e. "\parbox[c]{...}{...}" gives a slight improvement.
>

use m{...} for both columns

\documentclass{report}
\usepackage{array}
\begin{document}
   \begin{tabular} {|m{3cm}|m{5cm}|}
     \hline
     more more more more more more text
     &
     \rule{5cm}{2cm}
     \\
     \hline
     more more more more more more text
     &
         \rule{5cm}{2cm}
     \\
     \hline

   \end{tabular}
\end{document}

looks fine to me.

Otherwise you need to be more specific on what it is you want.

>
>
> I don't really like the above solution because it is quite inflexible to
> any layout changes, however, if I could give my parboxes above a little
> spaceing at least it would be better than anything I have seen yet.
>
> Can I center one parbox within another?
>

see the array package documentation

You might also want to consult some documentation on what happens when one 
has

\parbox[t]{...}{...}\parbox[c]{...}{...}\parbox[b]{...}{...}

the t,c,b controls how these are aligned., so since p{...} is equal to 
\parbox[t]{...}{...}, then

p{...} m{...}

means that the first baseline in the p-cell is aligned with 'vertical' 
middle of the m-cell. Since the contents of the m-cell is a picture 
standing on the baseline you will end up with a situation where the first 
baseline of the text in the p-cell is aligned with the middle of the 
picture. Which doesn't look good.

Same thing with the b{...} which just aligns with the last baseline of 
the text.


-- 

/daleif

``You cannot help men permanently by doing for them 
what they could and should do for themselves. ''
  -- Abraham Lincoln



More information about the texhax mailing list