2010-02-08 97 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

如果你不受限於一些嚴格定義的風格指南,這將是我的解決方案。