Latex 中缺少行 table

Line missing from Latex table

我用以下格式在乳胶中制作了一个table,

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

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

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

 \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