# line break in tabular

I try to set a line break within a tabular environment where the column is not definded with p{\$width}. I've tried the following without the expected result

\documentclass{article}
\begin{document}
expected result:

\begin{tabular}{|p{15mm}|l|l|}
\hline
X1\newline{}X2 & text & another text\\\hline
\end{tabular}

real result:

\begin{tabular}{|l|l|l|}
\hline
X1\newline{}X2 (no newline) & a text & another ext\\\hline
\begin{tabular}{l}
X1\\
X2
\end{tabular}
& a text (not on top) & another text\\\hline
\end{tabular}
\end{document}


Are there any hints?

-

put into another tabular:

\documentclass{article}
\def\Stack#1{\tabular[t]{@{}l@{}}#1\endtabular}
\begin{document}
expected result:

\begin{tabular}{|p{15mm}|l|l|}\hline
X1\newline{}X2 & text & another text\\\hline
\end{tabular}

real result:

\begin{tabular}{|l|l|l|}\hline
\Stack{X1\\X2} & a text & another ext\\\hline
\begin{tabular}{@{}l@{}}
X1\\
X2
\end{tabular}
& a text (not on top) & another text\\\hline
\end{tabular}
\end{document}


-
thanks. Is there a possibility to set in one cell a tabular environment on top (like \Stack) and in another a center vertical alignment? – Micha Feb 19 '13 at 17:29
\newcommand\Stack[2][t]{\tabular[#1]{@{}l@{}}#2\endtabular} then \Stack{...} and \Stack[c]{...} is possible. – Herbert Feb 19 '13 at 17:47

l columns are like \mbox they do not allow linebreaking. You need to use a p column or nest another structure such as a tabular or parbox in teh cell to allow more than one line, just as you would for \mbox or \fbox