这是我的表格:
\documentclass[review]{elsarticle}
\usepackage[table,xcdraw]{xcolor}
\usepackage{xcolor}
\begin{document}
\begin{table*}
\fontsize{3}{5}\selectfont
\tabcolsep=0.1cm
\caption{The type and number of refactorings performed on traditional OO code smells in the studied applications.} % title of Table
\label{NumberrefacOO}
\centering
\resizebox{1.0\linewidth}{!}{
\begin{tabular}{ll|llllllllll|c|c|}
\toprule
Refactoring & App & LC & CC & LPR & FE & LM & BC & MC & RB & SC & SG & \begin{tabular}[c]{@{}c@{}}Total\\ Smelly\end{tabular} & \begin{tabular}[c]{@{}c@{}}Total\\ Non-Smelly\end{tabular} \\ \midrule
Extract Method & \rowcolor[HTML]{DADADA} Apg & 2 & 50 & 37 & 72 & 106 & 12 & 20 & 1 & 29 & 8 & 337 & 523 \\
& congress & 4 & 33 & 12 & 16 & 75 & 1 & 5 & 0 & 0 & 0 & 146 & 405 \\
& \rowcolor[HTML]{DADADA} Netguard& 2 & 13 & 0 & 100 & 87 & 3 & 28 & 0 & 8 & 0 & 241 & 622 \\
& Notepad & 0 & 46 & 4 & 43 & 6 & 5 & 15 & 0 & 0 & 0 & 119 & 196 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 2 & 3 & 0 & 2 & 24 & 3 & 36 & 0 & 50 & 0 & 120 & 554 \\ \midrule
Move Method & Apg & 0 & 38 & 9 & 46 & 28 & 6 & 6 & 0 & 11 & 0 & 144 & 183 \\
& \rowcolor[HTML]{DADADA} congress & 7 & 5 & 15 & 14 & 4 & 1 & 12 & 0 & 0 & 0 & 58 & 255 \\
& Netguard & 1 & 26 & 0 & 102 & 1 & 0 & 2 & 0 & 0 & 0 & 132 & 243 \\
& \rowcolor[HTML]{DADADA} Notepad & 0 & 12 & 0 & 40 & 2 & 2 & 3 & 0 & 0 & 0 & 59 & 96 \\
& Omni-Notes & 0 & 24 & 6 & 4 & 28 & 2 & 26 & 3 & 14 & 0 & 107 & 210\\ \midrule
\begin{tabular}[c]{@{}l@{}}Extract and Move\end{tabular} & \rowcolor[HTML]{DADADA} Apg & 0 & 13 & 4 & 11 & 13 & 3 & 4 & 0 & 6 & 0 & 53 & 180 \\
Method & congress & 2 & 1 & 5 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 11 & 155 \\
& \rowcolor[HTML]{DADADA} Netguard & 2 & 1 & 1 & 0 & 3 & 0 & 1 & 0 & 1 & 0 & 9 & 190 \\
& Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 2 & 118 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 4 & 19 & 10 & 18 & 23 & 0 & 12 & 0 & 11 & 0 & 97 & 300 \\ \midrule
Inline Method & Apg & 0 & 4 & 0 & 4 & 4 & 3 & 4 & 0 & 2 & 0 & 21 & 95 \\
& \rowcolor[HTML]{DADADA} congress & 0 & 0 & 6 & 12 & 13 & 0 & 0 & 0 & 6 & 0 & 37 & 87 \\
& Netguard & 0 & 0 & 0 & 0 & 3 & 0 & 0 & 0 & 1 & 0 & 4 & 82 \\
& \rowcolor[HTML]{DADADA} Notepad & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 22 \\
& Omni-Notes & 0 & 4 & 7 & 4 & 4 & 1 & 4 & 0 & 2 & 0 & 26 & 86 \\ \midrule
Rename Method &\rowcolor[HTML]{DADADA} Apg & 1 & 39 & 33 & 37 & 76 & 4 & 15 & 0 & 13 & 7 & 225 & 354 \\
& congress & 1 & 17 & 6 & 4 & 16 & 4 & 6 & 0 & 0 & 0 & 54 & 261 \\
& \rowcolor[HTML]{DADADA} Netguard & 1 & 4 & 0 & 5 & 33 & 0 & 10 & 0 & 8 & 0 & 61 & 291 \\
& Notepad & 0 & 20 & 10 & 20 & 24 & 1 & 20 & 1 & 16 & 0 & 112 & 252 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 0 & 1 & 0 & 1 & 11 & 0 & 12 & 0 & 0 & 0 & 25 & 267 \\ \midrule
Move Attribute & Apg & 0 & 10 & 7 & 6 & 8 & 4 & 2 & 0 & 5 & 0 & 42 & 170 \\
& \rowcolor[HTML]{DADADA} congress & 0 & 4 & 0 & 36 & 10 & 2 & 16 & 0 & 0 & 0 & 68 & 476 \\
& Netguard & 0 & 0 & 0 & 0 & 3 & 0 & 1 & 0 & 1 & 0 & 5 & 93 \\
& \rowcolor[HTML]{DADADA} Notepad & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 2 & 46 \\
& Omni-Notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 13 \\ \midrule
Pull Up Method & \rowcolor[HTML]{DADADA} Apg & 0 & 1 & 0 & 3 & 1 & 0 & 3 & 0 & 0 & 1 & 9 & 131 \\
& congress & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Netguard & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \midrule
Pull Up Attribute & Apg & 0 & 6 & 2 & 8 & 6 & 0 & 0 & 0 & 4 & 0 & 26 & 72 \\
& \rowcolor[HTML]{DADADA} congress & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Netguard & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Notepad & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 49 \\
& Omni-Notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \midrule
Push Down Method & \rowcolor[HTML]{DADADA}Apg & 0 & 4 & 2 & 2 & 3 & 3 & 1 & 1 & 0 & 1 & 17 & 20 \\
& congress & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Netguard & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \midrule
Rename Class & Apg & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\
& \rowcolor[HTML]{DADADA} congress & 0 & 0 & 2 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 8 & 5 \\
& Netguard & 0 & 1 & 0 & 0 & 4 & 0 & 0 & 0 & 1 & 0 & 6 & 7\\
& \rowcolor[HTML]{DADADA} Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 \\
& Omni-Notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 5 \\ \midrule
Extract Super & \rowcolor[HTML]{DADADA} Apg & 2 & 6 & 4 & 5 & 9 & 0 & 3 & 1 & 1 & 12 & 43 & 39 \\
Class & congress & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Netguard & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} Omni-Notes & 0 & 0 & 2 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 4 & 8 \\ \midrule
Move Class & Apg & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& \rowcolor[HTML]{DADADA} congress & 0 & 3 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 4 & 0 \\
& Netguard & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
&\rowcolor[HTML]{DADADA} Notepad & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Omni-notes & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ \midrule
\rowcolor[HTML]{DADADA} \multicolumn{2}{l|}{\textbf{Total}} & \textbf{32} & \textbf{409} & \textbf{184} & \textbf{616} & \textbf{629} & \textbf{61} & \textbf{273} & \textbf{13} & \textbf{191} & \textbf{33} & \textbf{2,436} & \textbf{7,164} \\
\bottomrule
\end{tabular}}
\end{table*}
\end{document}
这是错误:
\end{tabular}}
I except to see \noalign only after the \cr of an alignment
答案1
从你的评论我猜你正在寻找类似这样的东西:
(红线表示页面布局。由包装决定geometry
)。
\documentclass[review]{elsarticle}
\usepackage[margin=25mm]{geometry}
\usepackage[table,xcdraw]{xcolor}
\usepackage{booktabs, makecell, multirow}
\usepackage{siunitx}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{table*}
\vspace{-0.5\baselineskip}
\linespread{0.8}\selectfont
\small
\setlength\tabcolsep{5pt}
\caption{The type and number of refactorings performed on traditional OO code smells in the studied applications.} % title of Table
\label{NumberrefacOO}
\centering
\rowcolors{1}{gray!30}{white}
\begin{tabular}{>{\columncolor{white}}p{4em}l
S[table-format=1.0]
*{2}{S[table-format=2.0]}
S[table-format=3.0]
*{6}{S[table-format=2.0]}
S[table-format=3.0]
S[table-format=3.0] }
\toprule
\rowcolor{white}
& & & & & & & & & & & &
\multicolumn{2}{c}{Total} \\
\cmidrule{13-14}
\rowcolor{white}
Refactoring
& App & {LC} & {CC} & {LPR} & {FE} & {LM} & {BC} & {MC} & {RB} & {SC} & {SG}
& {\makecell{Smelly}} & {\makecell{Non-\\Smelly}} \\
\Xhline{0.8pt}
& Apg
& 2 & 50 & 37 & 72 & 106 & 12 & 20 & 1 & 29 & 8 & 337 & 523 \\
\cellcolor{white}
& congress
& 4 & 33 & 12 & 16 & 75 & 1 & 5 & 0 & 0 & 0 & 146 & 405 \\
& Netguard
& 2 & 13 & 0 & 100 & 87 & 3 & 28 & 0 & 8 & 0 & 241 & 622 \\
\cellcolor{white}
& Notepad & 0 & 46 & 4 & 43 & 6 & 5 & 15 & 0 & 0 & 0 & 119 & 196 \\
\multirow[t]{-5}{=}{Extract Method}
& Omni-Notes
& 2 & 3 & 0 & 2 & 24 & 3 & 36 & 0 & 50 & 0 & 120 & 554 \\
\addlinespace
\cellcolor{white}
& Apg
& 0 & 38 & 9 & 46 & 28 & 6 & 6 & 0 & 11 & 0 & 144 & 183 \\
& congress
& 7 & 5 & 15 & 14 & 4 & 1 & 12 & 0 & 0 & 0 & 58 & 255 \\
\cellcolor{white}
& Netguard
& 1 & 26 & 0 & 102 & 1 & 0 & 2 & 0 & 0 & 0 & 132 & 243 \\
& Notepad
& 0 & 12 & 0 & 40 & 2 & 2 & 3 & 0 & 0 & 0 & 59 & 96 \\
\cellcolor{white}
\multirow[t]{-5}{=}{Move Method}
& Omni-Notes
& 0 & 24 & 6 & 4 & 28 & 2 & 26 & 3 & 14 & 0 & 107 & 210\\
\addlinespace
& Apg
& 0 & 13 & 4 & 11 & 13 & 3 & 4 & 0 & 6 & 0 & 53 & 180 \\
\cellcolor{white}
& congress & 2 & 1 & 5 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 11 & 155 \\
& Netguard
& 2 & 1 & 1 & 0 & 3 & 0 & 1 & 0 & 1 & 0 & 9 & 190 \\
\cellcolor{white}
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 2 & 118 \\
\multirow[t]{-5}{=}{Extract and Move}
& Omni-Notes
& 4 & 19 & 10 & 18 & 23 & 0 & 12 & 0 & 11 & 0 & 97 & 300 \\
\addlinespace
\cellcolor{white}
& Apg & 0 & 4 & 0 & 4 & 4 & 3 & 4 & 0 & 2 & 0 & 21 & 95 \\
& congress
& 0 & 0 & 6 & 12 & 13 & 0 & 0 & 0 & 6 & 0 & 37 & 87 \\
\cellcolor{white}
& Netguard
& 0 & 0 & 0 & 0 & 3 & 0 & 0 & 0 & 1 & 0 & 4 & 82 \\
& Notepad
& 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 22 \\
\cellcolor{white}
\multirow[t]{-5}{=}{Inline Method}
& Omni-Notes
& 0 & 4 & 7 & 4 & 4 & 1 & 4 & 0 & 2 & 0 & 26 & 86 \\
\addlinespace
&Apg
& 1 & 39 & 33 & 37 & 76 & 4 & 15 & 0 & 13 & 7 & 225 & 354 \\
\cellcolor{white}
& congress
& 1 & 17 & 6 & 4 & 16 & 4 & 6 & 0 & 0 & 0 & 54 & 261 \\
& Netguard
& 1 & 4 & 0 & 5 & 33 & 0 & 10 & 0 & 8 & 0 & 61 & 291 \\
\cellcolor{white}
& Notepad
& 0 & 20 & 10 & 20 & 24 & 1 & 20 & 1 & 16 & 0 & 112 & 252 \\
\multirow[t]{-5}{=}{Rename Method}
& Omni-Notes
& 0 & 1 & 0 & 1 & 11 & 0 & 12 & 0 & 0 & 0 & 25 & 267 \\
\addlinespace
\cellcolor{white}
& Apg
& 0 & 10 & 7 & 6 & 8 & 4 & 2 & 0 & 5 & 0 & 42 & 170 \\
& congress
& 0 & 4 & 0 & 36 & 10 & 2 & 16 & 0 & 0 & 0 & 68 & 476 \\
\cellcolor{white}
& Netguard
& 0 & 0 & 0 & 0 & 3 & 0 & 1 & 0 & 1 & 0 & 5 & 93 \\
& Notepad
& 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 2 & 46 \\
\cellcolor{white}
\multirow[t]{-5}{=}{Move Attribute}
& Omni-Notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 13 \\
\addlinespace
& Apg
& 0 & 1 & 0 & 3 & 1 & 0 & 3 & 0 & 0 & 1 & 9 & 131 \\
\cellcolor{white}
& congress
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Netguard
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cellcolor{white}
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\multirow[t]{-5}{=}{Pull Up Method}
& Omni-Notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\addlinespace
\cellcolor{white}
& Apg
& 0 & 6 & 2 & 8 & 6 & 0 & 0 & 0 & 4 & 0 & 26 & 72 \\
& congress
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cellcolor{white}
& Netguard
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Notepad
& 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 49 \\
\cellcolor{white}
\multirow[t]{-5}{=}{Pull Up Attribute}
& Omni-Notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\addlinespace
& Apg
& 0 & 4 & 2 & 2 & 3 & 3 & 1 & 1 & 0 & 1 & 17 & 20 \\
\cellcolor{white}
& congress
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Netguard
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cellcolor{white}
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\multirow[t]{-5}{=}{Push Down Method}
& Omni-Notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\addlinespace
\cellcolor{white}
& Apg
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\
& congress
& 0 & 0 & 2 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 8 & 5 \\
\cellcolor{white}
& Netguard
& 0 & 1 & 0 & 0 & 4 & 0 & 0 & 0 & 1 & 0 & 6 & 7\\
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 \\
\multirow[t]{-5}{=}{Rename Class}
\cellcolor{white}
& Omni-Notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 5 \\
\addlinespace
& Apg
& 2 & 6 & 4 & 5 & 9 & 0 & 3 & 1 & 1 & 12 & 43 & 39 \\
\cellcolor{white}
& congress
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Netguard
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cellcolor{white}
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\multirow[t]{-5}{=}{Extract Super}
& Omni-Notes
& 0 & 0 & 2 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 4 & 8 \\
\addlinespace
\cellcolor{white}
& Apg
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& congress
& 0 & 3 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 4 & 0 \\
\cellcolor{white}
& Netguard
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
& Notepad
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cellcolor{white}
& Omni-notes
& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
\Xhline{0.8pt}
\multicolumn{2}{l|}{\textbf{Total}}
& \textbf{32} & \textbf{409} & \textbf{184} & \textbf{616} & \textbf{629}
& \textbf{61} & \textbf{273} & \textbf{13} & \textbf{191} & \textbf{33}
& \textbf{2,436} & \textbf{7,164} \\
\Xhline{1.2pt}
\end{tabular}
\end{table*}
\end{document}