Eu tenho um documento com três tabelas. Essas três tabelas atualmente são muito longas para a página, então eu gostaria de fazer com que 2 tabelas aparecessem uma ao lado da outra e depois fizesse a terceira tabela aparecer abaixo delas. Dessa forma, todas as tabelas caberiam na mesma página.
Este é o meu MWE:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[margin=2.54cm]{geometry}
\usepackage{graphicx,booktabs,tabularx}
\usepackage[table]{xcolor}
\usepackage{array}
%define some nice colors
\definecolor{middleware_green}{RGB}{82, 119, 17}
\definecolor{middleware_white}{RGB}{255, 255, 255}
\definecolor{middleware_light_gray}{RGB}{239, 239, 239}
\definecolor{middleware_dark_gray}{RGB}{153, 153, 153}
\renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}
\newcolumntype{L}{>{\leavevmode\ignorespaces\raggedleft\arraybackslash\sffamily}X}%
\newcolumntype{C}{>{\leavevmode\ignorespaces\centering\arraybackslash\sffamily}X}%
\rowcolors{2}{middleware_white}{middleware_light_gray}
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{0.45\textwidth}{|L|L|L|L|}
\hline\rowcolor{middleware_green}
\multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline
\rowcolor{middleware_dark_gray}
\multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &
\multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 69 & 9 & \\ \cline{ 2- 3}
480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}
& 92 & 32 & \\ \hline
& 159 & 99 & \\ \cline{ 2- 3}
1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}
& 177 & 117 & \\ \hline
& 391 & 331 & \\ \cline{ 2- 3}
2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}
& 339 & 279 & \\ \hline
& 561 & 501 & \\ \cline{ 2- 3}
4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}
& 595 & 535 & \\ \hline
\end{tabularx}
\begin{tabularx}{0.45\textwidth}{|L|L|L|L|}
\hline\rowcolor{middleware_green}
\multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline
\rowcolor{middleware_dark_gray}
\multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &
\multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 69 & 9 & \\ \cline{ 2- 3}
480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}
& 92 & 32 & \\ \hline
& 159 & 99 & \\ \cline{ 2- 3}
1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}
& 177 & 117 & \\ \hline
& 391 & 331 & \\ \cline{ 2- 3}
2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}
& 339 & 279 & \\ \hline
& 561 & 501 & \\ \cline{ 2- 3}
4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}
& 595 & 535 & \\ \hline
\end{tabularx}
\begin{tabularx}{0.45\textwidth}{|L|L|L|L|}
\hline\rowcolor{middleware_green}
\multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline
\rowcolor{middleware_dark_gray}
\multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &
\multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &
\multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 60 & 0 & \\ \cline{ 2- 3}
240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}
& 60 & 0 & \\ \hline
& 69 & 9 & \\ \cline{ 2- 3}
480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}
& 92 & 32 & \\ \hline
& 159 & 99 & \\ \cline{ 2- 3}
1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}
& 177 & 117 & \\ \hline
& 391 & 331 & \\ \cline{ 2- 3}
2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}
& 339 & 279 & \\ \hline
& 561 & 501 & \\ \cline{ 2- 3}
4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}
& 595 & 535 & \\ \hline
\end{tabularx}
\label{tables_test}
\caption{three tables!}
\end{table}
\end{document}
Como posso conseguir isso? Como posso fazer com que essas três tabelas caibam em uma página?
Responder1
Os ambientes tabulares são posicionados usando as mesmas regras de uma carta, pois X
são espaçados apenas verticalmente, pois há uma quebra de parágrafo (linha em branco) entre cada um.