11

我有一个非常简单的表:

\begin{table}[t]
\begin{tabular}{|c||c|c|c|}
\hline
\multirow{2}{*}{Implementation}         & Test 1  & Test2  &  Test3    \\\hline
                                        & \multicolumn{3}{|c|}{results}   \\\hline\hline
\end{tabular}
\end{table}

它几乎“完美”地工作,我唯一的问题是 hline 仍然通过我合并的前两个单元格。基本上,它看起来像这样

"-------------------------------------------------"
"|                | Test 1 | Test 2 | Test 3 |"
" ----Implementation-------------------------------"
"|                |     results      |"  
"-------------------------------------------------"

但是,它应该是这样的:

"-------------------------------------------------" 
"|               | Test 1 | Test 2 | Test 3 |"
"   Implementation    ---------------------------"
"|               |      results     |"   
"-------------------------------------------------"

有人知道如何摆脱第一列中的行吗?

谢谢

4

2 回答 2

21

您想要的命令是 \cline{ij} ,它允许您仅在某些列上绘制行分隔符。有关详细信息,请参阅http://www.giss.nasa.gov/tools/latex/ltx-214.html

特别是,您需要使用 \cline{2-4} 在您提到的列之间绘制一条水平线。这是您的代码,其中一项更改是:

\begin{table}[t]
\begin{tabular}{|c||c|c|c|}
\hline
\multirow{2}{*}{Implementation}         & Test 1  & Test2  &  Test3    \\\cline{2-4}
                                        & \multicolumn{3}{|c|}{results}   \\\hline\hline
\end{tabular}
\end{table}
于 2010-02-08T19:40:43.470 回答
0

好吧,为了解决您的问题,我会注意到许多权威人士建议尽量减少表格中的内部墨水量(即\hline在普通行之间删除 s),并使用此处最后一个数字的内容。

如果您不受某些严格定义的样式指南的限制,这将是我的解决方案。

于 2010-02-08T19:44:06.990 回答