LaTeX table cells content vertical alignment problem
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开发者_开发问答
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}
\begin{tabular}{l|p{3cm}}
\vrule width 2cm height \ht\strutbox depth 5cm & Top align content ! \\
\end{tabular}
精彩评论