0

我在乳胶中制作了以下格式的表格,

\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}

但是,当我运行它时,右上角的桌子上缺少一条线。谁能帮我解决这个问题?我无法解决它。我正在使用在线乳胶。谢谢你。

4

2 回答 2

0
 \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 & sign
于 2016-10-25T03:17:14.323 回答
0

只需在此行末尾添加一个“&”: &\multicolumn{7}{c|}{Different values of K} &\\

于 2016-08-23T11:47:19.417 回答