How to center column values in a table? [duplicate]

If you use c , then you can't define / set a horizontal size limit for the column (such as 2.5cm in OP's example). If you use c , lines won't be automatically wrapped inside the table cells.

Commented Dec 24, 2016 at 18:28

Does this answer your question? How to create fixed width table columns with text raggedright/centered/raggedleft? [remark: the linked question is more general, but the answer there is better that it gets hyphenation and \newline correct]

Commented Apr 11, 2023 at 14:41

8 Answers 8

You have to load the package array , define a new column type with horizontal centering

\newcolumntype[1]<>p> 

and use this one ( P ) instead of p

\documentclass[conference] \usepackage \newcolumntype[1]<>p> \begin \begin \centering \begin<|P|P|P|> \hline Reconstruction strategy & aa & bb( \%) \\ \hline Classic & 3342 voxels & 68 \% \\ \hline VC & 4296 voxels & 87 \% \\ \hline V m=7 & 4745 voxels & 96 \% \\ \hline \end \newline\newline \caption\label \end \end

<a href=enter image description here" />

If you also want vertical centering, use m instead of p :

\documentclass[conference] \usepackage \newcolumntype[1]<>p> \newcolumntype[1]<>m> \begin \begin \centering \begin<|M|M|M|> \hline Reconstruction strategy & aa & bb( \%) \\ \hline Classic & 3342 voxels & 68 \% \\ \hline VC & 4296 voxels & 87 \% \\ \hline V m=7 & 4745 voxels & 96 \% \\ \hline \end \newline\newline \caption\label \end \end