Tables – How to Center a Table in the Middle of Two-Column Document

centertables

I want to center my table in the middle of a two-column document in Latex. I have tried the {table*} and "\centering" command and it works, but not completely. It left aligns the table instead of centering it across the two columns. Here is my code. I would appreciate any tips on how to center this table properly.

\begin{table*}
\centering
\caption{Monte Carlo Simulation Results vs. Historical Food Distributions}
\label{table:DistributionComparison}
\begin{tabular}{@{}llllcll@{}}
\toprule
\multicolumn{2}{l}{Simulation} & \multicolumn{2}{l}{Historical} & Difference between means &        &                  \\ \midrule
$M_1$            & $(SD_1)$           & $M_2$             & $(SD_2)$            & $M_1$ - $M_2$ {[}95\% CI{]}    & $t(460)$  & $p$                \\ \midrule
146,797          & (3,786)          & 122,468           & (27,411)           & 24,330 {[}21,080, 27,578{]}    & 14.7132  & \textless{}0.001 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item Note. $ N=462$. CI = Confidence Interval; $n_1 = 450$. $n_2 = 12$. 
\end{tablenotes}
\end{table*}

Best Answer

You haven't provided the full code to compile and test so I am guessing the annotation are moved left because table itself should be centred.

First, the table* environment creates space of the full width but your table is is not that wide. I never used tablesnotes this way and I guess because it is not a part of the table, it is moved to the left margin with a small indentation as tablesnotes create a list.

If you want annotation to be aligned with the table, remove tablesnotes and either insert one more row below \bottomrule with all cells merged

 \multicolumn{7}{@{}l}{\small Note. ...}

or apply threeparttable as in the example below, which I would recommend

enter image description here

\documentclass[twocolumn]{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{kantlipsum}

\begin{document}
\kant[1-4]

\begin{table*}
  \centering
  \begin{threeparttable}
    \caption{Monte Carlo Simulation Results vs. Historical Food Distributions}
    \label{table:DistributionComparison}
    \begin{tabular}{@{}llllcll@{}}
      \toprule
      \multicolumn{2}{c}{Simulation}
      & \multicolumn{2}{c}{Historical}
      & Difference between means
      & & \\
      \midrule
      $M_1$   & $(SD_1)$ & $M_2$   & $(SD_2)$ & $M_1$ - $M_2$ {[}95\% CI{]} & $t(460)$ & $p$ \\
      \midrule
      146,797 & (3,786)  & 122,468 & (27,411) & 24,330 {[}21,080, 27,578{]} & 14.7132  & $<0.001$ \\
      \bottomrule
    \end{tabular}
    {\small Note. $ N=462$. CI = Confidence Interval; $n_1 = 450$. $n_2 = 12$.}
  \end{threeparttable}
\end{table*}

\kant[2-5]
\end{document}
Related Question