I'm trying to horizontally align two tables using the package subcaption:
\documentclass[12pt, a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{minipage}[c]{0.4\textwidth}
\centering
\captionof{table}{table no. 1}
\begin{tabular}{cccc}
& 1 & 2 & 3 \\
\hline
Number1 & 10550 & 95767 & 867835 \\
Number2 & 1000 & 455653 & 56467 \\
\hline
Number1 & 7566 & 6776 & 56657 \\
Number2 & 5646 & 56765 & 67668 \\
\hline
\end{tabular}
\end{minipage}
\begin{minipage}[c]{0.4\textwidth}
\centering
\captionof{table}{table no. 2}
\begin{tabular}{cccc}
& 1 & 2 & 3 \\
\hline
Number1 & 44760 & 97567 & 857835 \\
Number2 & 13200 & 46653 & 5756 \\
\hline
Number1 & 75666 & 66776 & 5654657 \\
Number2 & 5646 & 57665 & 676685 \\
\hline
\end{tabular}
\end{minipage}
\end{document}
but the two tables end up overlapping:
Is there a way to resize the tables to avoid the overlap?
In general you should rather use a suitable font size instead of resizing elements which contain text.
However in your case, resizing is not necessary. The tables will fit if:
the indention at the start of the line is removed with
\noindent
the minipages are resizes to .5\textwidth so they span the whole page
additional spacing before and after the columns is removed with
@{}
%
is used to avoid unprotected line endings which otherwise would act like spacesif you like even more space between the tables, you could reduce the inter column spacing