I wanted to make a table with the text centered in every box of the table, both horizontally and vertically. This is my code:
\renewcommand{\arraystretch}{1.5}
\begin{center}
\begin{tabular}{ |>{\centering}p{0.5cm}|>{\centering}p{0.5cm}|>{\centering}p{0.5cm}|p{0.5cm}| }
\hline
A & B & C & $\varphi$ \\
\hline
\end{tabular}
\end{center}
and this is the result:
(I removed the other 8 lines of the code, because they were basically the same)
And now the thing is, the fourth column isn't centered and when I put >{\centering} before p{0.5cm}, exactly how I did on the first 3 columns, Tex would give me
Any ideas how to fix this?
Thanks.


>{\centering\arraybackslash}p{0.5cm}. – Torbjørn T. Nov 19 '16 at 15:17