我有一张大桌子,这意味着我需要将 elsarticle 文档更改为横向。我遇到的问题是桌子超出了页面,我不知道如何解决这个问题。
MWE 如下:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{landscape}
\begin{table*}
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{table*}
\end{landscape}
\end{document}
答案1
我认为\begin{landscape}
页面布局有问题。发现页码放错了位置。
minipage
我会用里面的手动旋转表格rotatebox
。需要使用\centering
将表格放在页面中间。
检查这是否足以解决您的问题:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
%\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
%\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{table*}
\centering
\rotatebox{90}{
\begin{minipage}{\textwidth}
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{minipage}
}
\end{table*}
\end{document}
答案2
只需代替table
即可table*
:
\documentclass[final,10p,twocolumn,authoryear]{elsarticle}
\usepackage[a4paper,width=180mm,top=25mm,bottom=25mm]{geometry}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{landscape}
\begin{table}
\centering
\caption[Caption.]{Caption.}
\label{label}
\begin{tabular}{ p{0.082\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} p{0.08\textwidth} } \toprule
& \multicolumn{8}{c}{Something} & ~ \\
Something & \multicolumn{3}{c}{Something(2)} & \multicolumn{3}{c}{Something(1)} & \multicolumn{3}{c}{Something (0)} & Something \\
& Some & Some & Some & Some & Some & Some & Some & Some & Some & \\ \midrule
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\ \hdashline
Something (2) & \textbf{data (data\%)} & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data (data\%) & data \\
\bottomrule
\end{tabular}
\end{table}
\end{landscape}
\end{document}