我只是想将列中的小数点对齐。我知道这个问题已经得到解答了,但我不知道如何在我的表格中应用它。请原谅我,我对 LaTeX 还很陌生。这是我的代码:
\begin{table}[h]
\begin{center}
\begin{tabular}{ccc|cc|cc|c}
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&$D$&$E$&$D$&$E$&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\end{tabular}
\end{center}
\end{table}
还有一件事。如果我的表格太长,我想把它剪短,让另一半放在另一页上,可以吗?如果要求不高的话,你能告诉我怎么做吗?
答案1
对于对齐,请参见第一条评论中重复的错误。对于分页,您可以使用包longtable
中的环境longtable
。有关更多详细信息,请参阅其文档。我将您的示例转换为 longtable 和 siunitx(用于对齐)并将其加长以显示分页:
\documentclass{article}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
\begin{longtable}[c]{ccc|SS|SS|S}
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\hline\hline
\multirow{2}{*}{$A$} & \multirow{2}{*}{$B$} & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} &
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} & \multirow{3}{*}{5} & 12 & 2.146 & 9.144 & 6.311 & 9.566 & 7.134 \\ \cline{3-8}
&& 14 & 3.245 & 10.255 & 6.978 & 19.274 & 18.245 \\ \cline{3-8}
&& 16 & 7.176 & 11.968 & 10.852 & 47.485 & 25.282 \\ \hline\hline
\end{longtable}
\end{document}