centering table

LaTeX centering table

StartSearchLaTeX for Beginners F.A.Q. LaTeX faqLaTeX topicsLaTeX course
< change height of a row/cell     > fixed width in a table

table centering

How to center a table in LaTex?

Solution

To center a table, you can use the center environment.

Example

\documentclass{article}
\begin{document}
text \\
\begin{tabular}{|r|c|l|}
\hline 
A & B & C \\
\hline 
1 & 2 & 3 \\
\hline 
\end{tabular}\\
\ \\
some \\
text \\
to \\
see \\
the \\
difference\\
\begin{center}
\begin{tabular}{|r|c|l|}
\hline 
A & B & C \\
\hline 
1 & 2 & 3 \\
\hline 
\end{tabular}
\end{center}

\end{document}
Output:

Hint

If you use the table-environment, you just have to set the command \centering to get the table centered.

example 2

\begin{table}
\centering
\begin{tabular}{|r|c|l|}
\hline 
A & B & C \\
\hline 
1 & 2 & 3 \\
\hline 
\end{tabular}
\end{table}

Contact   Privacy Policy   disclosures

accept decline

This website uses cookies and pixel tags to ensure you get the best experience on our website. By using this website, you consent to the use of cookies.learn more about cookies see also our privacy policy