Possible Duplicate:
Center column with specifying width in table (tabular enviroment)?
I want to fix this code, the last column aren't center in the cell. How can I center the text of all table? I get an error.
\documentclass[10pt,a4paper]{article}
\title{\textbf{Title}}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage{color, colortbl}
\definecolor{Gray}{gray}{0.9}
\usepackage{enumitem}
\usepackage{anysize}
\marginsize{3cm}{3cm}{2.5cm}{2.5cm}
\usepackage{xcolor}
\usepackage{caption}
\captionsetup[table]{skip=10pt}
\usepackage{threeparttable}
\begin{document}
\begin{table}[h]
\begin{threeparttable}
\caption{Tabla\tnote{1}}
\centering
\begin{tabular}{|p{18mm}|p{35mm}|p{20mm}|p{30mm}|p{22mm}|}
\hline \rowcolor{Gray}
\centering \textbf{Text} & \centering \textbf{Text} & \centering\textbf{Text} & \centering\textbf{Text} & {\centering\textbf{Text}}\\[0.5ex]
\hline
176682 & text & text & text & text\\
\hline
176682 & text & text & text & text\\
\hline
176682 & text & text & text & text\\
\hline
176682 & text & text & text & text\\
\hline
text & text & text & text & text\\
\hline
text & text & text & text & text\\
\hline
text & text & text & text & text\\
\hline
\end{tabular}
\begin{tablenotes}
\item[1] Source.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
newcolumntype. something like\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}and useC{22mm}as column instead ofp{22mm}– hpesoj626 Dec 13 '12 at 05:32\begin{tabular}{|>{\centering\arraybackslash}p{18mm}|>{\centering\arraybackslash}p{35mm}|>{\centering\arraybackslash}p{20mm}|>{\centering\arraybackslash}p{30mm}|>{\centering\arraybackslash}p{22mm}|}– Isai Dec 13 '12 at 05:53