I'm having trouble getting two tables to sit nicely next to each other. I get errors like this:
Overfull \hbox (255.00095pt too wide) in paragraph at lines 9--35
It looks like this:
It seems to insist on this big stupid blank spot (much wider than the margin) that takes up the first quarter of the page, and causes the fourth quarter of the content to fall off the edge, despite using \centering, \begin{centered}, etc.
You can see I tried a few different things (commented out).
Here's the code:
\documentclass[varwidth]{article}
\usepackage{booktabs}
\begin{document}
% \begin{table}
% \begin{minipage}[t][29.7cm][c]{21cm}
\begin{tabular}{cc}
\begin{tabular}{cccc}
\toprule
& $X$ & $X$ & $XXX$ \\
\midrule
XXXXXX & XXXXXXXX & XXXXXXXX & XXXXXXXX \\
\midrule
XXXXXXX & XXX & XXX & XXX \\
\bottomrule
\end{tabular} &
% \caption{A}\label{tab:first}
% \end{minipage}%
% \begin{minipage}[t][29.7cm][c]{21cm}
\begin{tabular}{cccc}
\toprule
& $X$ & $X$ & $XXX$ \\
\midrule
XXXXXX & XXXXXXXX & XXXXXXXX & XXXXXXXX \\
\midrule
XXXXXXX & XXX & XXX & XXX \\
\bottomrule
\end{tabular}
\end{tabular}
% \caption{B}\label{tab:second}
% \end{minipage}
% \end{table}
\end{document}
So, I have two tables side by side and they overflow into the righthand margin. How can I split the difference between both margins (bleed evenly into each) to keep the tables centered? Just to clear up any confusion, here are a couple of mockups to show the kind of thing I'm going for.




\usepackage[margin=5mm,showframe]{geometry}to your example and it will fit. (You'll also need a\noindentin front of your firsttabularenvironment if you don't put everything in atableenvironment.) – David Purton Aug 07 '19 at 04:14\usepackage{showframe}in your preamble. – leandriis Aug 07 '19 at 09:04\hspace*{-1in}either side then it can be 2in bigger than\textwidthwithout being overfull. – David Carlisle Aug 07 '19 at 18:58