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}


ltype, so no line break is allowed. – egreg Jun 11 '22 at 09:32tabularin the affecting cell:\begin{tabular}[t]{@{} l @{}} text 1\\text 22 \end{tabular}if you want to stick to thelcolumn type. – Celdor Jun 11 '22 at 09:57makecellpackage and use\makecell[l]{text1 \\ text2}for standard column types. – Bernard Jun 11 '22 at 10:01p{<width>}simply fixes its column width to<width>, in oppose tolwhich adjusts a column width to its content.p{}also changes a vertical alignment to top from the default middle. Other similar column types such asm{}andb{}do the same asp{}but change vertical alignments to middle and bottom, respectively. – Celdor Jun 11 '22 at 10:27