[Tex/LaTex] How to center the table in Latex

tables

I have got a simple code to generate table in Latex.

\begin{tabular}{ | c | c | c | }
  \hline
  symbol & value & unit \\ \hline            
  $z Na$ & 11 & - \\ \hline      
  $z F$ & 9 & - \\ \hline      
  $Emax Na$ & 0.545 & $[MeV]$ \\ \hline
\end{tabular}

This code is good, but I would like to add this table to my document in Latex and have this table centered. The point is that table would be in the middle not on the left nor on the right but in the middle. I tried this, but it didn't work:

\{center}
\begin{tabular}{ | c | c | c | }
  \hline
  symbol & value & unit \\ \hline            
  $z Na$ & 11 & - \\ \hline      
  $z F$ & 9 & - \\ \hline      
  $Emax Na$ & 0.545 & $[MeV]$ \\ \hline
\end{tabular}
\{\center}

I appreciate the answer.

Best Answer

You can just add \centering right after \begin{table} to center the table:

\begin{table}
\centering
\begin{tabular}
...
\end{tabular}
\end{table}

As commented by @PeterGrill, if you are not using floats (i.e., \begin{table}, \end{table}), then you will need to group it:

{
\centering
\begin{tabular} 
... 
\end{tabular}
} 

(note the extra {}).

Related Question