Put two, three, or multiple tables side by side in LaTeX
In this tutorial, I will show you how to get two, three, or multiple tables side by side in a LaTeX document. And how to add individual captions for every table.
Put multiple tables side by side with a global caption
In order to insert multiple tables side by side in a LaTeX document you can use the table
environment and inside the table
environment, you can put multiple tabular
environments.
In this case, you will get only one caption which will be a global caption for all of the tables.
\documentclass{article} \begin{document} \begin{table}[h] \centering \begin{tabular}{|c|c|c|} \hline 1 & 2 & 3 \\\hline 4 & 5 & 6 \\ \hline \end{tabular} \quad \begin{tabular}{|c|c|c|} \hline A & B & C \\\hline D & E & F \\ \hline \end{tabular} \quad \begin{tabular}{|c|c|c|} \hline a & b & c \\\hline d & e & f \\ \hline \end{tabular} \caption{Three table side by side} \end{table} \begin{table}[h] \centering \begin{tabular}{|c|c|c|} \hline 1 & 2 & 3 \\\hline 4 & 5 & 6 \\ \hline \end{tabular} \quad \begin{tabular}{|c|c|c|} \hline A & B & C \\\hline D & E & F \\ \hline \end{tabular} \quad \begin{tabular}{|c|c|c|} \hline a & b & c \\\hline d & e & f \\ \hline \end{tabular} \quad \begin{tabular}{|c|c|c|} \hline g & h & i \\\hline j & k & l \\ \hline \end{tabular} \caption{Four table side by side} \end{table} \end{document}
Output:
Put multiple tables side by side with individual captions for each table
To get individual captions for all tables you have to use the mimipage
environment.
You just have to put all the tabular
inside a minipage
environment then you can add \caption{}
all of the tables individually. You can also add the global caption for all.
To customize the caption you can use the caption
package. After loading the caption
package, the : symbol will be removed automatically if the \caption{}
is empty. And also, you can use \caption*{<text>}
to remove Table 1, Table 2, etc.
\documentclass{article} \usepackage{caption} % To customize the captions \begin{document} \begin{table}[h] \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline 1 & 2 & 3 \\\hline 4 & 5 & 6 \\ \hline \end{tabular} \caption{} \end{minipage}% \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline A & B & C \\\hline D & E & F \\ \hline \end{tabular} \caption{} \end{minipage}% \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline a & b & c \\\hline d & e & f \\ \hline \end{tabular} \caption{} \end{minipage} \caption{Three table side by side with separate captions} \end{table} \begin{table}[h] \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline 1 & 2 & 3 \\\hline 4 & 5 & 6 \\ \hline \end{tabular} \caption*{a. Natural Numbers} \end{minipage}% \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline A & B & C \\\hline D & E & F \\ \hline \end{tabular} \caption*{b. Capital Letter} \end{minipage}% \begin{minipage}{.3\linewidth} \centering \begin{tabular}{|c|c|c|} \hline a & b & c \\\hline d & e & f \\ \hline \end{tabular} \caption*{c. Small Letter} \end{minipage} \caption{Three table side by side with separate custom captions} \end{table} \end{document}
Output:
Leave a Reply