【问题标题】:Line missing from Latex tableLatex 表中缺少行
【发布时间】:2016-08-23 10:54:33
【问题描述】:
我用乳胶制作了一张表格,格式如下,
\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
xelatex
latex-environment
biblatex
【解决方案1】:
只需在此行末尾添加一个“&”:
&\multicolumn{7}{c|}{Different values of K} &\\
【解决方案2】:
\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