There is a problem while I use newline in the tabular environment. Namely, from the following exemple in the column 3 the \newline adds a new line and it works as intended, however in the column 4 no new line is created for \newline command (please check the attached image below). Could you please tell why does it appear? By the way I am using array package.
\begin{center}
\begin{tabular}{|l|l|>{\raggedright\arraybackslash}p{5cm}|l|}
\hline
\rule[-1ex]{0pt}{2.5ex} ID & text & text & text \\
\hline
\rule[-1ex]{0pt}{2.5ex} 1 & text & text & text1 \newline text2\\
\hline
\rule[-1ex]{0pt}{2.5ex} 2 & text & text & \\
\hline
\rule[-1ex]{0pt}{2.5ex} 3 & text & text & \\
\hline
\rule[-1ex]{0pt}{2.5ex} 4 & text& text & \\
\hline
\rule[-1ex]{0pt}{2.5ex} 5 & text & text1 \newline text2 & text1 \newline text 2\\
\hline
\end{tabular}
\end{center}
l
type, so no line break is allowed.tabular
in the affecting cell:\begin{tabular}[t]{@{} l @{}} text 1\\text 22 \end{tabular}
if you want to stick to thel
column type.makecell
package and use\makecell[l]{text1 \\ text2}
for standard column types.