Usually, you can center tables with \center. But when the table is longer than the \textwidth, it will be align with the left side margin. You can temporarily adjust the textwidth.
% allows for temporary adjustment of side margins
\usepackage{chngpage}
\begin{table}
\begin{adjustwidth}{-.5in}{-.5in}
\begin{center}
\begin{tabular}{|c|}
\hline
And here comes a very long line. And here comes a very long line. And here comes a very long line. \\
\hline
\end{tabular}
\caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. }
\label{myTable}
\end{center}
\end{adjustwidth}
\end{table}
% allows for temporary adjustment of side margins
\usepackage{chngpage}
\begin{table}
\begin{adjustwidth}{-.5in}{-.5in}
\begin{center}
\begin{tabular}{|c|}
\hline
And here comes a very long line. And here comes a very long line. And here comes a very long line. \\
\hline
\end{tabular}
\caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. }
\label{myTable}
\end{center}
\end{adjustwidth}
\end{table}
Thank you for posting this! I just used it in my Masters thesis!
ReplyDeletethank you very much!!
ReplyDeletethank you very much
ReplyDeleteThis was extremely helpful, thank you
ReplyDelete