I have a problem with vertically aligning content in a tabular
environment:
\documentclass{article}
\begin{document}
\begin{tabular}{ p{2em} p{2em} }
test & \begin{tabular}{l} s s s \\ s s s \end{tabular} \\
\end{tabular}
\end{document}
Which as far as I understand the array
documentation should give me two table cells which are top-aligned and have a with of 2em
.
The thing is that if I don't have a table in the second cell but simply text then it works as intended:
\documentclass{article}
\begin{document}
\begin{tabular}{ p{2em} p{2em} }
\hline
test & s s s s s s s s s s s s s s s \\
\hline
\end{tabular}
\end{document}
What is the reason for the difference in appearance?
Best Answer
It's easier to see the baselines of the two columns if the second column has some additional text:
See in the second row the inner table aligns on its top row as
[t]
has been added, but in both cases the first column of the outer table is aligned with its baseline aligned with the baseline of the second column.(Note the image in your question is not generated from the posted code)