我用latex做了一个表格,格式如下,
\begin{table}[H]
\centering
\begin{tabular}{|p{3.5cm}|l|l|l|l|l|l|l|p{1.0cm}|}
\hline
&\multicolumn{7}{c|}{Different values of K}\\
\cline{2-8}
1 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & sum\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
\end{tabular}
\caption {sum}
\label{tab:sum}
\end{table}然而,当我运行它时,在右上角的表格上缺少一行。有人能帮我解决这个问题吗?我不能解决它。我正在使用在线latex。谢谢。
发布于 2016-08-23 19:47:19
只需在该行末尾添加一个"&“即可:&\multicolumn{7}{c|}{Different values of K} &\\
发布于 2016-10-25 11:17:14
\begin{table}[h]
\centering
\begin{tabular}{|p{3.5cm}|l|l|l|l|l|l|l|p{1.0cm}|}
\hline
&\multicolumn{7}{c|}{Different values of K}&\\
\cline{2-8}
1 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & sum\\ \hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline
\end{tabular}
\caption {sum}
\label{tab:sum}
\end{table}
% Here is the corrected version. You need to replace H by h and
%after sum put & signhttps://stackoverflow.com/questions/39099202
复制相似问题