# Caption Centered but Table is not

For some reason the caption is aligned in the center of the page but the table is too far to the right. How can I have both centered?

\documentclass{article}
\usepackage{booktabs}
\usepackage[justification=centering]{caption}
\begin{document}

\begin{table}[htbp]
\centering
\caption{X \\ Y}
\smallskip

\begin{tabular}{l rlrlrl }

\midrule[\heavyrulewidth]
& \multicolumn{2}{c}{Model 1}
& \multicolumn{2}{c@{}}{Model 2}
& \multicolumn{2}{c@{}}{Model 3} \\

\midrule
\midrule

Variable Variable Variable 1 (Variable) Variable & 17.122 & * &   3.481 &* & 0.138 &* \\

\end{tabular}
Note: XYZ
\end{table}
\end{document}

-
Leave a blank line between \end{tabular} and Note: XYZ. Also it wouldn't use \smallskip before tabular. –  Harish Kumar Mar 18 '13 at 1:12

The table and Note: XYZ are on the same line and so are centred together. If you do not want that, put a blank line between them and they will each be centred individually.

If your text is too wide (as shown in the edited question) then you need to limit the widths of the columns, for example you can use a p column of a fixed width:

\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\usepackage[justification=centering]{caption}
\begin{document}

\begin{table}[htbp]
\centering
\caption{X \\ Y}
\smallskip

\begin{tabular}{>{\raggedright}p{5cm} rlrlrl }

\midrule[\heavyrulewidth]
& \multicolumn{2}{c}{Model 1}
& \multicolumn{2}{c@{}}{Model 2}
& \multicolumn{2}{c@{}}{Model 3} \\

\midrule
\midrule

Variable Variable Variable 1 (Variable) Variable &
17.122 & * &   3.481 &* & 0.138 &* \\

\end{tabular}

Note: XYZ

X\dotfill X
\end{table}
\end{document}

-
My edit did not load in time. The problem is the variable names I have are long, and for some reason, even after the fix above the table is still off to the right. –  Chris J Mar 18 '13 at 1:37
@CJ12 updated answer –  David Carlisle Mar 18 '13 at 1:46
Perfect! Answer accepted. –  Chris J Mar 18 '13 at 1:55