Reputation: 121
I have a very simple table:
\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}
It works almost "perfect", the only problem that I have is that the hline still goes through the first two cells that I have merged. Basically, it looks like this
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" ----Implementation-------------------------------"
"| | results |"
"-------------------------------------------------"
However, it should like this:
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" Implementation ---------------------------"
"| | results |"
"-------------------------------------------------"
Anyone an idea how to get rid of the line in the first column?
Thanks
Upvotes: 11
Views: 26483
Reputation: 16253
The command you want is \cline{i-j} which lets you draw a row divider across only certain columns. See http://www.giss.nasa.gov/tools/latex/ltx-214.html for details.
In particular, you'll want to use \cline{2-4} to draw a horizontal line across just the columns you mentioned. Here's your code with the one change:
\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}
Upvotes: 21
Reputation: 101269
Well, to not address your question, I'll note that many authorities suggest minimizing the amount of internal ink in your table (i.e. ditch the \hline
s between ordinary rows), and using something line the last figure here.
If you are not constrained by some tightly defined style guide, this would be my solution.
Upvotes: 0