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

Dan Bolser dmb at mrc-dunn.cam.ac.uk
Sun Jun 12 17:30:15 CEST 2005


On Sun, 12 Jun 2005, Lars Madsen wrote:

>>>
>>> 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.

Smashing! It looks beautiful!

Thank you!



>
>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.
>
>
>



More information about the texhax mailing list