Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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} 
share|improve this question
1  
As far as why the table is centered in your original document, perhaps you are suing a solution similar to How can I center all tables in a document?, but without seeing the code it is difficult to know for sure. –  Peter Grill Jun 11 '12 at 6:38

1 Answer 1

up vote 27 down vote accepted

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} 
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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