# How to align cells vertically in a nested tabular?

Here is a minimal example that illustrates my problem.

\documentclass{article}

\begin{document}
\begin{tabular}{@{}lp{2cm}@{}}
\hline
Top left!  & This is a long cell \\\hline
Top left!  & This is another long cell \\\hline
Not top left!  &
\begin{tabular}{@{}ll@{}}
cell1&cell2\\
cell3&cell4\\
cell5&cell6
\end{tabular}
\\\hline
\end{tabular}
\end{document}


The result looks like this:

My question: How to achieve that in the third row the first cell is vertically aligned at the top, as it is already the case for the two previous rows?

Why does the vertical alignment change?

I asked the question too quickly. The solution is counterintuitive, but still fairly simple.

For the inner tabular, we need to add the option [t] for vertical alignment. I kept trying to set the vertical alignment option for the outer tabular...

Here is the fixed solution:

\documentclass{article}

\begin{document}
\begin{tabular}{@{}lp{2cm}@{}}
\hline
Top left!  & This is a long cell \\\hline
Top left!  & This is another long cell \\\hline
Also top left!  &
\begin{tabular}[t]{@{}ll@{}}
cell1&cell2\\
cell3&cell4\\
cell5&cell6
\end{tabular}
\\\hline
\end{tabular}
\end{document}