同一页面上的两个旋转表格

同一页面上的两个旋转表格

抱歉,我发现我要问的问题有多种变体,但我没有找到解决我特定问题的答案。我有两个旋转的表格,它们有点窄。我不想将它们放在两个单独的页面上,而是想将它们都放在一个页面上。我怎样才能最有效地做到这一点?

\documentclass[english]{article}
\usepackage{lscape}
 \usepackage{threeparttable}

\begin{document}
    \begin{landscape}
    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset \label{tab:testa}}
    \begin{tabular}{lccccccc} \hline
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations  \\ \cline{2-8}
     \multicolumn{1}{c}{ Category} & Average   & Std. Dev. & Coeff. of Var. & Average  & Std. Dev. & Coeff. of Var.   \\ \hline
    Audio  & 12\%   & 0.32  & 2.76  & 12.9  & 20.0  & 1.6  & 11,367  \\
    Auto Parts  & 14\%  & 0.35 & 2.44 & 21.9 & 54.1 & 2.5  & 7,211 \\
    Cable  & 11\% & 0.31 & 2.91 & 10.9  & 19.8 & 1.8  & 9,398  \\
    Computer  & 11\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
    Imaging  & 11\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
    Mobile Phone  & 16\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
    Phone & 14\%                            & 0.35                           & 2.47           & 16.1          & 30.6          & 1.9          & 5,777             \\
    TV & 8\%                             & 0.28                           & 3.28           & 11.3          & 21.5          & 1.9          & 9,413             \\
    TV Box  & 14\%                            & 0.34                           & 2.52           & 14.7          & 28.5          & 1.9          & 9,799             \\
     \textbf{Sample Average}  & \textbf{12\%} & \textbf{0.33} & \textbf{2.72}  & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \hline
    \end{tabular}
    \end{threeparttable}}
    \end{table}%
    \end{landscape}

    \begin{landscape}
    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Jewelry Dataset \label{tab:testb}}
    \begin{tabular}{lccccccc} \hline
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations  \\ \cline{2-8}
      \multicolumn{1}{c}{Category} & Average                         & Std. Dev.                      & Coeff. of Var. & Average       & Std. Dev.     & Coeff. of Var.                   \\ 
    Accessories & 4\%   & 0.19  & 5.18  & 23.28 & 19.69 & 0.85 & 20,583 \\
    Bracelets & 7\%   & 0.26  & 3.64  & 22.70 & 14.71 & 0.65 & 61,997 \\
    Earrings & 8\%   & 0.27  & 3.46  & 24.40 & 17.30 & 0.71 & 308,385 \\
    Necklaces & 7\%   & 0.25  & 3.67  & 23.74 & 18.12 & 0.76 & 255,470 \\
    Rings & 8\%   & 0.27  & 3.43  & 24.94 & 23.01 & 0.92 & 51,121 \\
    \textbf{Sample Average} & \textbf{7\%} & \textbf{0.25} & \textbf{3.87} & \textbf{23.81} & \textbf{18.57} & \textbf{0.78} & \textbf{616,127} \\ \hline
        \end{tabular}%
    \end{threeparttable}}
    \end{table}%
    \end{landscape}

\end{document}

答案1

在此处输入图片描述

仅使用一个景观环境,而不是两个。

\documentclass[english]{article}
\usepackage{lscape}
 \usepackage{threeparttable}

\begin{document}
    \begin{landscape}
    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset \label{tab:testa}}
    \begin{tabular}{lccccccc} \hline
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations  \\ \cline{2-8}
     \multicolumn{1}{c}{ Category} & Average   & Std. Dev. & Coeff. of Var. & Average  & Std. Dev. & Coeff. of Var.   \\ \hline
    Audio  & 12\%   & 0.32  & 2.76  & 12.9  & 20.0  & 1.6  & 11,367  \\
    Auto Parts  & 14\%  & 0.35 & 2.44 & 21.9 & 54.1 & 2.5  & 7,211 \\
    Cable  & 11\% & 0.31 & 2.91 & 10.9  & 19.8 & 1.8  & 9,398  \\
    Computer  & 11\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
    Imaging  & 11\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
    Mobile Phone  & 16\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
    Phone & 14\%                            & 0.35                           & 2.47           & 16.1          & 30.6          & 1.9          & 5,777             \\
    TV & 8\%                             & 0.28                           & 3.28           & 11.3          & 21.5          & 1.9          & 9,413             \\
    TV Box  & 14\%                            & 0.34                           & 2.52           & 14.7          & 28.5          & 1.9          & 9,799             \\
     \textbf{Sample Average}  & \textbf{12\%} & \textbf{0.33} & \textbf{2.72}  & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \hline
    \end{tabular}
    \end{threeparttable}}
    \end{table}%
    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Jewelry Dataset \label{tab:testb}}
    \begin{tabular}{lccccccc} \hline
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & Total Observations  \\ \cline{2-8}
      \multicolumn{1}{c}{Category} & Average                         & Std. Dev.                      & Coeff. of Var. & Average       & Std. Dev.     & Coeff. of Var.                   \\ 
    Accessories & 4\%   & 0.19  & 5.18  & 23.28 & 19.69 & 0.85 & 20,583 \\
    Bracelets & 7\%   & 0.26  & 3.64  & 22.70 & 14.71 & 0.65 & 61,997 \\
    Earrings & 8\%   & 0.27  & 3.46  & 24.40 & 17.30 & 0.71 & 308,385 \\
    Necklaces & 7\%   & 0.25  & 3.67  & 23.74 & 18.12 & 0.76 & 255,470 \\
    Rings & 8\%   & 0.27  & 3.43  & 24.94 & 23.01 & 0.92 & 51,121 \\
    \textbf{Sample Average} & \textbf{7\%} & \textbf{0.25} & \textbf{3.87} & \textbf{23.81} & \textbf{18.57} & \textbf{0.78} & \textbf{616,127} \\ \hline
        \end{tabular}%
    \end{threeparttable}}
    \end{table}%
    \end{landscape}

\end{document}

答案2

将它们放在一个landscape环境中,用空行隔开。我对布局进行了一些改进(加载caption,在标题和表格之间留出适当的垂直间距,在水平规则周围和 最后一列标题周围booktabs添加一些填充):multirow

\documentclass[english]{article}
\usepackage{geometry} 
\usepackage{booktabs, multirow, caption} 
\usepackage{lscape}
 \usepackage{threeparttable}

\begin{document}
    \begin{landscape}
    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset \label{tab:testa}}
    \begin{tabular}{l*{7}{c}} \toprule
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & \multirow{2}{*}[-\aboverulesep]{Total Observations}\\
    \cmidrule(lr){2-4} \cmidrule(lr){5-7} 
     \multicolumn{1}{c}{ Category} & Average & Std. Dev. & Coeff. of Var. & Average & Std. Dev. & Coeff. of Var. \\ \midrule
    Audio & 12\,\% & 0.32 & 2.76 & 12.9 & 20.0 & 1.6 & 11,367 \\
    Auto Parts & 14\,\% & 0.35 & 2.44 & 21.9 & 54.1 & 2.5 & 7,211 \\
    Cable & 11\,\% & 0.31 & 2.91 & 10.9 & 19.8 & 1.8 & 9,398 \\
    Computer & 11\,\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
    Imaging & 11\,\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
    Mobile Phone & 16\,\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
    Phone & 14\,\% & 0.35 & 2.47 & 16.1 & 30.6 & 1.9 & 5,777 \\
    TV & 8\,\% & 0.28 & 3.28 & 11.3 & 21.5 & 1.9 & 9,413 \\
    TV Box & 14\,\% & 0.34 & 2.52 & 14.7 & 28.5 & 1.9 & 9,799 \\
     \textbf{Sample Average} & \textbf{12\,\%} & \textbf{0.33} & \textbf{2.72} & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \bottomrule
    \end{tabular}
    \end{threeparttable}}
    \end{table}%

    \begin{table}\centering
    \scalebox{1}{
    \begin{threeparttable}
    \caption{Return Lag and Return Rate Descriptive Statistics for Jewelry Dataset \label{tab:testb}}
    \begin{tabular}{l*{7}{c}} \toprule
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & \multirow{2}{*}[-\aboverulesep]{Total Observations} \\ 
    \cmidrule(lr){2-4} \cmidrule(lr){5-7}
      \multicolumn{1}{c}{Category} & Average & Std. Dev. & Coeff. of Var. & Average & Std. Dev. & Coeff. of Var. \\\midrule
    Accessories & 4\,\% & 0.19 & 5.18 & 23.28 & 19.69 & 0.85 & 20,583 \\
    Bracelets & 7\,\% & 0.26 & 3.64 & 22.70 & 14.71 & 0.65 & 61,997 \\
    Earrings & 8\,\% & 0.27 & 3.46 & 24.40 & 17.30 & 0.71 & 308,385 \\
    Necklaces & 7\,\% & 0.25 & 3.67 & 23.74 & 18.12 & 0.76 & 255,470 \\
    Rings & 8\,\% & 0.27 & 3.43 & 24.94 & 23.01 & 0.92 & 51,121 \\
    \textbf{Sample Average} & \textbf{7\,\%} & \textbf{0.25} & \textbf{3.87} & \textbf{23.81} & \textbf{18.57} & \textbf{0.78} & \textbf{616,127} \\ \bottomrule
        \end{tabular}%
    \end{threeparttable}}
    \end{table}%
    \end{landscape}

\end{document} 

在此处输入图片描述

添加

加载makecell标准表格中的换行符(和通用格式),您不要必须使用landscape mode此代码:

%%%%%%%%%%%%%%%%%%%%%
 \begin{table}\centering
 \begin{threeparttable}
 \caption{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset \label{tab:testa}}
 \begin{tabular}{l*{7}{c}} \toprule
 & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & \multirowcell{3}[-\aboverulesep]{Total \\Observations}\\
 \cmidrule(lr){2-4} \cmidrule(lr){5-7}
 \multicolumn{1}{c}{ Category} & Avg. & Std. Dev. & \makecell{Coeff.\\ of Var.} & Avg. & Std. Dev. & \makecell{Coeff.\\ of Var.} \\ \midrule
 Audio & 12\,\% & 0.32 & 2.76 & 12.9 & 20.0 & 1.6 & 11,367 \\
 Auto Parts & 14\,\% & 0.35 & 2.44 & 21.9 & 54.1 & 2.5 & 7,211 \\
 Cable & 11\,\% & 0.31 & 2.91 & 10.9 & 19.8 & 1.8 & 9,398 \\
 Computer & 11\,\% & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21,811 \\
 Imaging & 11\,\% & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7,823 \\
 Mobile Phone & 16\,\% & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3,126 \\
 Phone & 14\,\% & 0.35 & 2.47 & 16.1 & 30.6 & 1.9 & 5,777 \\
 TV & 8\,\% & 0.28 & 3.28 & 11.3 & 21.5 & 1.9 & 9,413 \\
 TV Box & 14\,\% & 0.34 & 2.52 & 14.7 & 28.5 & 1.9 & 9,799 \\
 \thead[lc]{Sample\\ Average} & \textbf{12\,\%} & \textbf{0.33} & \textbf{2.72} & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \textbf{1,201.05} \\ \bottomrule
 \end{tabular}
 \end{threeparttable}
 \end{table}%

 \begin{table}\centering
 \begin{threeparttable}
 \caption{Return Lag and Return Rate Descriptive Statistics for Jewelry Dataset \label{tab:testb}}
 \begin{tabular}{l*{7}{c}} \toprule
 & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & \multirowcell{3}[-\aboverulesep]{Total\\ Observations} \\
 \cmidrule(lr){2-4} \cmidrule(lr){5-7}
 \multicolumn{1}{c}{Category} & Avg. & Std. Dev. & \makecell{Coeff.\\ of Var. }& Avg. & Std. Dev. & \makecell{Coeff. \\of Var.} \\\midrule
 Accessories & 4\,\% & 0.19 & 5.18 & 23.28 & 19.69 & 0.85 & 20,583 \\
 Bracelets & 7\,\% & 0.26 & 3.64 & 22.70 & 14.71 & 0.65 & 61,997 \\
 Earrings & 8\,\% & 0.27 & 3.46 & 24.40 & 17.30 & 0.71 & 308,385 \\
 Necklaces & 7\,\% & 0.25 & 3.67 & 23.74 & 18.12 & 0.76 & 255,470 \\
 Rings & 8\,\% & 0.27 & 3.43 & 24.94 & 23.01 & 0.92 & 51,121 \\
 \thead[lc]{Sample\\ Average} & \textbf{7\,\%} & \textbf{0.25} & \textbf{3.87} & \textbf{23.81} & \textbf{18.57} & \textbf{0.78} & \textbf{616,127} \\ \bottomrule
 \end{tabular}%
 \end{threeparttable}
 \end{table}%

在此处输入图片描述

答案3

无需旋转,可读性增强:

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,siunitx,etoolbox}
\robustify\bfseries
\usepackage[margin=1in]{geometry}
\begin{document}

\sisetup{detect-weight=true,detect-inline-weight=math}
\begin{table}\centering
\caption{Return Lag and Return Rate Descriptive Statistics for Electronics Dataset\label{tab:testa}}
    \smallskip
    \begin{tabular}{@{}l*6{c}S[table-format=6.2]@{}} \toprule
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} &{Total} \\ \cmidrule(lr){2-4}\cmidrule(lr){5-7}
    Category & (1) & (2) & (3) & (1) & (2) & (3) & {observations} \\ \midrule
    Audio  & 12   & 0.32  & 2.76  & 12.9  & 20.0  & 1.6  & 11367  \\
    Auto Parts  & 14  & 0.35 & 2.44 & 21.9 & 54.1 & 2.5  & 7211 \\
    Cable  & 11 & 0.31 & 2.91 & 10.9  & 19.8 & 1.8  & 9398  \\
    Computer  & 11 & 0.31 & 2.90 & 11.1 & 23.0 & 2.1 & 21811 \\
    Imaging  & 11 & 0.31 & 2.92 & 11.8 & 19.9 & 1.7 & 7823 \\
    Mobile Phone  & 16 & 0.37 & 2.27 & 28.9 & 74.4 & 2.6 & 3126 \\
    Phone & 14                            & 0.35                           & 2.47           & 16.1          & 30.6          & 1.9          & 5777             \\
    TV & 8                             & 0.28                           & 3.28           & 11.3          & 21.5          & 1.9          & 9413             \\
    TV Box  & 14                            & 0.34                           & 2.52           & 14.7          & 28.5          & 1.9          & 9799             \\
    \textbf{Sample Avg.}  & \textbf{12} & \textbf{0.33} & \textbf{2.72}  & \textbf{15.5} & \textbf{32.4} & \textbf{2.0} & \bfseries 1201.05 \\ \bottomrule
    \multicolumn{8}{l}{\small(1) Average (\%)}         \\
    \multicolumn{8}{l}{\small(2) Standard deviation}   \\
    \multicolumn{8}{l}{\small(3) Coefficient of standard deviation}
    \end{tabular}
\end{table}%

\begin{table}[h]\centering
\caption{Return Lag and Return Rate Descriptive Statistics for Jewelry Dataset \label{tab:testb}}
    \smallskip
    \begin{tabular}{@{}l*6{c}S[table-format=6]@{}} \toprule
    & \multicolumn{3}{c}{Return Rate} & \multicolumn{3}{c}{Return Lag} & {Total} \\ \cmidrule(lr){2-4}\cmidrule(lr){5-7}
    Category & (1) & (2) & (3) & (1) & (2) & (3) & {observations} \\ \midrule 
    Accessories & 4   & 0.19  & 5.18  & 23.28 & 19.69 & 0.85 & 20583 \\
    Bracelets & 7   & 0.26  & 3.64  & 22.70 & 14.71 & 0.65 & 61997 \\
    Earrings & 8   & 0.27  & 3.46  & 24.40 & 17.30 & 0.71 & 308385 \\
    Necklaces & 7   & 0.25  & 3.67  & 23.74 & 18.12 & 0.76 & 255470 \\
    Rings & 8   & 0.27  & 3.43  & 24.94 & 23.01 & 0.92 & 51121 \\
    \textbf{Sample Avg.} & \textbf{7} & \textbf{0.25} & \textbf{3.87} & \textbf{23.81} & \textbf{18.57} & \textbf{0.78} & \bfseries 616127 \\ \bottomrule
    \multicolumn{8}{l}{\small(1) Average (\%)}         \\
    \multicolumn{8}{l}{\small(2) Standard deviation}   \\
    \multicolumn{8}{l}{\small(3) Coefficient of standard deviation}
    \end{tabular}%
\end{table}%

\end{document}

相关内容