2010-02-08 98 views
10

我有一个非常简单的表:合并单元格中的LaTeX表

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

任何一个想法如何在第一列摆脱线的?

感谢

回答

19

你想要的命令是\ {克莱恩I-J},它可让您在只有某些列绘制列分隔符。详细信息请参见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} 
0

好了,解决您的问题,我会注意到,许多当局建议您在表最大限度地减少内部的墨水量(即沟普通的\hline小号行),并使用行the last figure here

如果你不受限于一些严格定义的风格指南,这将是我的解决方案。