我想将两个表格分别对齐到同一页上,顶部和底部边距具有相同的空间。这是我的表格的小型 MWE(它们要大得多)
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{threeparttable}
\usepackage{booktabs}
\begin{document}
\begin{table}[hbt!] \centering
\begin{threeparttable}
\caption{a}
\begin{tabular}{@{\extracolsep{4pt}}lcccccc}
\toprule
a & b & c & d \\
\hline \\[-1.8ex]
a & 14.40 $\%$ & 60.99 $\%$ & Yes \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table2
\begin{table}[hbt!] \centering
\begin{threeparttable}
\caption{b}
\begin{tabular}{@{\extracolsep{4pt}}ccccccc}
\toprule
& a & b & c &
d & e \\
\hline \\[-1.8ex]
& 0.3 & 16.98 $\%$ & 13.31 $\%$ & 17.86 $\%$ & 2.98 $\%$
\\
& 0.5 & 14.38 $\%$& 10.17 $\%$ & 18.18 $\%$ & 2.98 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[h] \centering
\begin{threeparttable}
\caption{c}
\begin{tabular}{@{\extracolsep{4pt}}clcccccc}
\toprule
& a & b & d & d &e & f & g \\
\hline \\[-1.8ex]
& 0.3 & 16.64 $\%$ & 15.32 $\%$ & 16.77 $\%$ & 11.87 $\%$ & 15.65 $\%$ & 12.94 $\%$ \\
& 0.5 & 15.59 $\%$ & 11.25 $\%$ & 14.72 $\%$ & 7.95 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[h]
\centering
\begin{threeparttable}
\caption{d}
\begin{tabular}{@{\extracolsep{4pt}}clcccccc}
\toprule
& a & b & c & d & e & f & g \\
\hline \\[-1.8ex]
& 0.3 & 24.72 $\%$ & 20.96 $\%$ & 48.54 $\%$ & 86.44 $\%$ & 80.20 $\%$ & 63.64 $\%$
\\
& 0.5 & 11.60 $\%$& 7.94 $\%$ & 40.98 $\%$ & 74.70 $\%$ & 75.96 $\%$ & 42.22 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}
具体来说,我希望表 1 和表 2 在一页上“均匀分布”,表 3 和表 4 在新页面上也“均匀分布”。
答案1
看看以下内容是否是您所寻找的:
\documentclass{article}
\usepackage{booktabs,
threeparttable}
\NewExpandableDocumentCommand\mcc{O{1}m}{\multicolumn{#1}{c}{#2}} %
\usepackage[skip=1ex]{caption}
\usepackage{siunitx}
\begin{document}
\begin{table}[p]
\centering
\sisetup{table-format=2.2{\,\%}}
\caption{d}
\begin{tabular}{c*{2}{S<{\,\%}} c }
\toprule
a & \mcc{b} & \mcc{c} & d \\
\midrule
a & 14.40 & 60.99 & Yes \\
\bottomrule
\end{tabular}
\end{table}
%Table2
\begin{table}[p]
\centering
\sisetup{table-format=2.2{\,\%}}
\caption{d}
\begin{tabular}{c*{5}{S<{\,\%}}}
\toprule
a & \mcc{b} & \mcc{c} & \mcc{d} & \mcc{e} \\
\midrule
0.3 & 16.98 & 13.31 & 17.86 & 2.98 \\
0.5 & 14.38 & 10.17 & 18.18 & 2.98 \\
\bottomrule
\end{tabular}
\end{table}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[p]
\centering
\sisetup{table-format=2.2{\,\%}}
\caption{d}
\begin{tabular}{c*{7}{S<{\,\%}}}
\toprule
a & \mcc{b} & \mcc{c} & \mcc{d} & \mcc{e} & \mcc{f} & \mcc{g} \\
\midrule
0.3 & 16.64 & 15.32 & 16.77 & 11.87 & 15.65 & 12.94 \\
0.5 & 15.59 & 11.25 & 14.72 & 7.95 & \mcc{} & \mcc{} \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[p]
\centering
\sisetup{table-format=2.2{\,\%}}
\caption{d}
\begin{tabular}{c*{7}{S<{\%}}}
\toprule
a & \mcc{b} & \mcc{c} & \mcc{d} & \mcc{e} & \mcc{f} & \mcc{g} \\
\midrule
0.3 & 24.72 & 20.96 & 48.54 & 86.44 & 80.20 & 63.64 \\
0.5 & 11.60 & 7.94 & 40.98 & 74.70 & 75.96 & 42.22 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
- 我从您的 MWE 中删除了所有内容
threeparttable
,因为我没有看到您需要什么(您没有tablenotes
,但是将它们返回并不困难)。 - 对于带有数字的列,我使用
S
按小数点对齐的列类型 - 正如我在评论中提到的那样,对于放置选项,我
[p]
使用\clearpage
\newpage
答案2
table[p]
这是一个每页使用一个环境、tabular
每个使用两个环境的解决方案table
。
我还建议用 替换所有\hline \\[-1.8ex]
实例\midrule
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{threeparttable,booktabs}
\begin{document}
\begin{table}[p]
\centering
\begin{threeparttable}
\caption{a}
\begin{tabular}{lccc}
\toprule
a & b & c & d \\
\midrule
a & 14.40 $\%$ & 60.99 $\%$ & Yes \\
\bottomrule
\end{tabular}
\end{threeparttable}
\bigskip\bigskip
\begin{threeparttable}
\caption{b}
\begin{tabular}{ccccc}
\toprule
a & b & c & d & e \\
\midrule
0.3 & 16.98 $\%$ & 13.31 $\%$ & 17.86 $\%$ & 2.98 $\%$ \\
0.5 & 14.38 $\%$ & 10.17 $\%$ & 18.18 $\%$ & 2.98 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\clearpage
\begin{table}[p]
\centering
\begin{threeparttable}
\caption{c}
\begin{tabular}{lcccccc}
\toprule
a & b & c & d & e & f & g \\
\midrule
0.3 & 16.64 $\%$ & 15.32 $\%$ & 16.77 $\%$ & 11.87 $\%$ & 15.65 $\%$ & 12.94 $\%$ \\
0.5 & 15.59 $\%$ & 11.25 $\%$ & 14.72 $\%$ & 7.95 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\bigskip\bigskip
\begin{threeparttable}
\caption{d}
\begin{tabular}{lcccccc}
\toprule
a & b & c & d & e & f & g \\
\midrule
0.3 & 24.72 $\%$ & 20.96 $\%$ & 48.54 $\%$ & 86.44 $\%$ & 80.20 $\%$ & 63.64 $\%$ \\
0.5 & 11.60 $\%$ & 7.94 $\%$ & 40.98 $\%$ & 74.70 $\%$ & 75.96 $\%$ & 42.22 $\%$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}