17

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} 
32

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} 
  • 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 – Abhimanyu Arora Jun 11 '12 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.