You have to load the package array
, define a new column type with horizontal centering
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
and use this one (P
) instead of p
\documentclass[conference]{IEEEtran}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|P{2.5cm}|P{2.5cm}|P{2.5cm}|}
\hline
Reconstruction strategy & aa & bb( \%) \\ \hline
Classic & 3342 voxels & 68 \% \\ \hline
VC & 4296 voxels & 87 \% \\ \hline
V m=7 & 4745 voxels & 96 \% \\ \hline
\end{tabular}
\newline\newline
\caption{title}\label{tab1}
\end{table}
\end{document}
Output:
If you also want vertical centering, use m
instead of p
:
\documentclass[conference]{IEEEtran}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|M{2.5cm}|M{2.5cm}|M{2.5cm}|}
\hline
Reconstruction strategy & aa & bb( \%) \\ \hline
Classic & 3342 voxels & 68 \% \\ \hline
VC & 4296 voxels & 87 \% \\ \hline
V m=7 & 4745 voxels & 96 \% \\ \hline
\end{tabular}
\newline\newline
\caption{title}\label{tab1}
\end{table}
\end{document}
Output:
\begin{tabular}{ccc}
c
, then you can't define / set a horizontal size limit for the column (such as2.5cm
in OP's example). If you usec
, lines won't be automatically wrapped inside the table cells.\newline
correct]