19

Strangely in this MWE the table is shifted to the left but in my original document I have exactly the same code but the table is centered. Can anyone solve the mystery?

\documentclass{article}

\begin{document}

\begin{table}[H]
\caption{Robustness checks---Organised events}
\begin{tabular}{lc} \hline
VARIABLES & Org. event \\ \hline
 &  \\
Price shock & -0.212 \\
 & (0.177) \\
 &  \\
Observations & 2,226 \\
Number of city\_group & 37 \\
R-squared & -0.021 \\ \hline
\multicolumn{2}{c}{ Robust standard errors in parentheses} \\
\multicolumn{2}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}
\end{table}

\end{document} 
1

1 Answer 1

35

Adding \centering after \begin{table} will center the table:

enter image description here

Notes:

  • The showframe package was used to add the margins so that the centering effect can be seen.
  • Using centering is preferred over the center environment as the environment adds additional vertical space.

Code:

\documentclass{article}
\usepackage{showframe}

\begin{document}
\begin{table}[H]
\centering
\caption{Robustness checks---Organised events}
\begin{tabular}{lc} \hline
VARIABLES & Org. event \\ \hline
 &  \\
Price shock & -0.212 \\
 & (0.177) \\
 &  \\
Observations & 2,226 \\
Number of city\_group & 37 \\
R-squared & -0.021 \\ \hline
\multicolumn{2}{c}{ Robust standard errors in parentheses} \\
\multicolumn{2}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}
\end{table}
\end{document} 
1
  • Thanks @PeterGrill, for now I'll use centering to solve this. In a rush for a deadline. I'll come back to this mystery a bit later. Cheers Commented Jun 11, 2012 at 7:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .