tags:

views:

209

answers:

3

Hello, I'd like to align text in right cell of table created below, to be vertically align to the top. How to do that ?

\begin{tabular}{l|p{3cm}}
    \rule{2cm}{5cm} & Top align content ? \\
\end{tabular}

Regards

+2  A: 
\begin{tabular}{l|p{3cm}} 
    \vrule width 2cm height \ht\strutbox depth 5cm & Top align content ! \\ 
\end{tabular} 
Alexey Malistov
A: 

Thanks!

But I don't actually understand that clearly. How about making top alignment of the second cell content, while in the first cell is something else, for example table ?

\begin{tabular}{p{1cm}|p{3cm}} 
    \begin{tabular}{|l|} 
        \hline text \\ text \\ text\\ text \\ \hline
    \end{tabular}
    & Top align content ? \\ 
\end{tabular}

Regards

Jarek Waliszko
A: 

Answer to second qeustion You should make your table in the first cell to be top aligned.

If you write

\begin{tabular}{|l|}  
    \hline text \\ text \\ text\\ text \\ \hline 
\end{tabular}

then you get a center aligned table.

Write

\begin{tabular}{p{1cm}|p{3cm}}  
    \vtop{\vskip 0pt \vskip -\ht\strutbox 
    \begin{tabular}{|l|}  
        \hline text \\ text \\ text\\ text \\ \hline 
    \end{tabular}\vskip -\dp\strutbox }%
    & Top align content ? \\  
\end{tabular} 
Alexey Malistov
Thanks for that!
Jarek Waliszko