怎样才能在一页上以 3x2 矩阵的形式放置五张表格?

怎样才能在一页上以 3x2 矩阵的形式放置五张表格?

我想将多个代码生成的表格插入到文档中,以便它们显示在一页上。我可能需要使用较小的字体才能使它们全部适合。所有表格都是相同大小,并且已经位于tabular带有标题和标签的自己的块中。最好的策略是什么?

答案1

您可以将表格放入 minipages 或 parboxes 中,也可以使用包subfig。请记住,您不能将多个table环境放在一起,但您可以将多个tabular环境(带有标题和标签)放在一个table环境中。subfig文档中包含有关这两种技术的信息。

parboxes下面是使用和的示例minipages

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs}
\begin{document}

\begin{table}[htbp]
\centering

\parbox{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
A & B & C \\
\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\

\bottomrule
\end{tabular}
\caption{ABC}
}\bigskip
\parbox{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
D & E & F \\
\midrule
0.692628962 & 0.676885786 & 0.714726267 \\
0.216724956 & 0.514742162 & 0.274775702 \\
0.520019549 & 0.506134903 & 0.293514122 \\
0.186925802 & 0.285319488 & 0.403563324 \\

\bottomrule
\end{tabular}
\caption{DEF}
}\bigskip

\parbox{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
G & H & I \\
\midrule
0.037156909 & 0.76115364 & 0.238202162 \\
0.086680665 & 0.028714787 & 0.879055353 \\
0.302193464 & 0.157574379 & 0.948781632 \\
0.503584342 & 0.885553012 & 0.30105766 \\

\bottomrule
\end{tabular}
\caption{GHI}
}\bigskip
\parbox{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
J & K & L \\
\midrule
0.652587435 & 0.812241976 & 0.816788302 \\
0.456616676 & 0.320706153 & 0.882116653 \\
0.616582591 & 0.361915305 & 0.772590298 \\
0.78771219 & 0.53200612 & 0.564641396 \\

\bottomrule
\end{tabular}
\caption{JKL}
}
\parbox{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
M & N & O \\
\midrule
0.733808918 & 0.699601932 & 0.11500169 \\
0.873043748 & 0.12076117 & 0.682781587 \\
0.918180185 & 0.63535945 & 0.445837393 \\
0.417373347 & 0.731406679 & 0.669593201 \\

\bottomrule
\end{tabular}
\caption{MNO}
}
\parbox{.45\textwidth}{\ }
\end{table}

\begin{table}[htbp]
\centering

\begin{minipage}{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
A & B & C \\
\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\

\bottomrule
\end{tabular}
\caption{ABC}
}\end{minipage}\bigskip
\begin{minipage}{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
D & E & F \\
\midrule
0.692628962 & 0.676885786 & 0.714726267 \\
0.216724956 & 0.514742162 & 0.274775702 \\
0.520019549 & 0.506134903 & 0.293514122 \\
0.186925802 & 0.285319488 & 0.403563324 \\

\bottomrule
\end{tabular}
\caption{DEF}
}\end{minipage}\bigskip

\begin{minipage}{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
G & H & I \\
\midrule
0.037156909 & 0.76115364 & 0.238202162 \\
0.086680665 & 0.028714787 & 0.879055353 \\
0.302193464 & 0.157574379 & 0.948781632 \\
0.503584342 & 0.885553012 & 0.30105766 \\

\bottomrule
\end{tabular}
\caption{GHI}
}\end{minipage}\bigskip
\begin{minipage}{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
J & K & L \\
\midrule
0.652587435 & 0.812241976 & 0.816788302 \\
0.456616676 & 0.320706153 & 0.882116653 \\
0.616582591 & 0.361915305 & 0.772590298 \\
0.78771219 & 0.53200612 & 0.564641396 \\

\bottomrule
\end{tabular}
\caption{JKL}
}\end{minipage}
\begin{minipage}{.45\textwidth}{
\begin{tabular}[t]{lll}

\toprule
M & N & O \\
\midrule
0.733808918 & 0.699601932 & 0.11500169 \\
0.873043748 & 0.12076117 & 0.682781587 \\
0.918180185 & 0.63535945 & 0.445837393 \\
0.417373347 & 0.731406679 & 0.669593201 \\

\bottomrule
\end{tabular}
\caption{MNO}
}\end{minipage}
\begin{minipage}{.45\textwidth}{\ }\end{minipage}
\end{table}

\end{document}

答案2

调整表格的大小,使三个表格放在一行中:

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,graphicx,blindtext}

\begin{document}

\blindtext

\begin{table}
\centering
\minipage{0.32\textwidth}
\resizebox{\linewidth}{!}{%
\begin{tabular}{lll}\toprule
A & B & C \\\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\\bottomrule
\end{tabular}}
\caption{ABC}
\endminipage\hfill%
%
\minipage{0.32\textwidth}
\resizebox{\linewidth}{!}{%
\begin{tabular}{lll}\toprule
A & B & C \\\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\\bottomrule
\end{tabular}}
\caption{ABC second}
\endminipage\hfill%
%
\minipage{0.32\textwidth}
\resizebox{\linewidth}{!}{%
\begin{tabular}{lll}\toprule
A & B & C \\\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\\bottomrule
\end{tabular}}
\caption{ABC third}
\endminipage

\bigskip
\minipage{0.32\textwidth}
\resizebox{\linewidth}{!}{%
\begin{tabular}{lll}\toprule
A & B & C \\\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\\bottomrule
\end{tabular}}
\caption{ABC forth}
\endminipage\space%
%
\minipage{0.32\textwidth}
\resizebox{\linewidth}{!}{%
\begin{tabular}{lll}\toprule
A & B & C \\\midrule
0.096356125 & 0.126535287 & 0.222951743 \\
0.011227006 & 0.154678302 & 0.134139901 \\
0.695793117 & 0.287078523 & 0.077578477 \\
0.325214308 & 0.069604001 & 0.657673026 \\\bottomrule
\end{tabular}}
\caption{ABC fifth}
\endminipage%
\end{table}

\end{document}

相关内容