Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem in my multirow and multicolumn table. As you can see in the figure, there is an extra horizontal line over the first column. Can anybody tell me how to remove it. I constructed the entire table with the help of articles given in Latex WikiBooks.

This is my code:

\documentclass[letterpaper, 10 pt, conference]{ieeeconf}  
\IEEEoverridecommandlockouts                              
\overrideIEEEmargins      
\usepackage{multirow}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}
%-----------------------------------------------%
\begin{table}[!t]   \label{table:accuracy}
\centering
\caption{Title.}
\begin{tabular}{| c | c | c | c | c |} \cline{1-4}

& \multicolumn{3}{ c| }{A} \\
\hline 

\multicolumn{1}{|p{1cm}|}{\centering A= \\ $[B,C]$} & \multirow{2}{*}{C} & \multirow{2} {*}{D} & \multicolumn{1}{|p{1.5cm}|}{\centering E+ \\ F} & \multicolumn{1}{|p{1.8cm}|} {\centering G+\\+H+I}  \\  
\hline \hline 
$[4,1]$        &    30.22\%  &   46.67\%  &  44.27\%  &  30.48\%   \\
$[4,2]$      &    76.94\%  &   73.27\%  &  80.03\%  &  38.47\%   \\         
$[4,3]$      &    55.22\%  &   68.75\%  &  71.66\%  &  57.29\%   \\         
$[4,4]$      &    98.98\%  &   79.52\%  &  82.59\%  &  21.84\%   \\
$[5,2]$      &    36.94\%  &   56.48\%  &  63.25\%  &  47.40\%   \\     
$[5,3]$      &    63.99\%  &   53.30\%  &  51.70\%  &  59.32\%   \\         
$[5,4]$      &    46.46\%  &   39.06\%  &  39.94\%  &  59.91\%   \\         
$[6,4]$      &    96.80\%  &   96.80\%  &  100\%    &  98.17\%     \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering R \\ S}  &  \multirow{2}{*}{56.37\%} &  \multirow{2}{*}{58.33\%} &  \multirow{2}{*}{\textbf{60.15\%}}  &  \multirow{2}{*}{\textbf{51.76\%}} \\     
\hline
\end{tabular}
\end{table}

\end{document}

The top figure shows how it is currently, and how I would like it to be:

enter image description here

share|improve this question
    
Please edit your question to be a complete document and show the image from that document, your fragment can't be run but presumably doesn't generate that image as Guided filter and other text is not shown. –  David Carlisle Jun 9 at 20:33
    
@DavidCarlisle Oh yes sorry. Done. –  Parag S. Chandakkar Jun 9 at 20:38
    
Now it should run as a standalone too. I hope. –  Parag S. Chandakkar Jun 9 at 20:42

1 Answer 1

up vote 3 down vote accepted

You had the column count incorrect in you \cline (also don't use \label before \caption. I used the standard article as I didn't hav ethe conference class you are using

\documentclass[letterpaper, 10 pt, conference]{article}  

\usepackage{multirow}

\begin{document}


\thispagestyle{empty}
\pagestyle{empty}
%-----------------------------------------------%
\begin{table}
\centering
\caption{Title.}\label{table:accuracy}
\smallskip
\begin{tabular}{| c | c | c | c | c |} \cline{2-4}

\multicolumn{1}{c|}{}
& \multicolumn{3}{ c| }{A} \\
\hline 

\multicolumn{1}{|p{1cm}|}{\centering A= \\ $[B,C]$} & \multirow{2}{*}{C} & \multirow{2} {*}{D} & \multicolumn{1}{|p{1.5cm}|}{\centering E+ \\ F} & \multicolumn{1}{|p{1.8cm}|} {\centering G+\\+H+I}  \\  
\hline \hline 
$[4,1]$        &    30.22\%  &   46.67\%  &  44.27\%  &  30.48\%   \\
$[4,2]$      &    76.94\%  &   73.27\%  &  80.03\%  &  38.47\%   \\         
$[4,3]$      &    55.22\%  &   68.75\%  &  71.66\%  &  57.29\%   \\         
$[4,4]$      &    98.98\%  &   79.52\%  &  82.59\%  &  21.84\%   \\
$[5,2]$      &    36.94\%  &   56.48\%  &  63.25\%  &  47.40\%   \\     
$[5,3]$      &    63.99\%  &   53.30\%  &  51.70\%  &  59.32\%   \\         
$[5,4]$      &    46.46\%  &   39.06\%  &  39.94\%  &  59.91\%   \\         
$[6,4]$      &    96.80\%  &   96.80\%  &  100\%    &  98.17\%     \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering R \\ S}  &  \multirow{2}{*}{56.37\%} &  \multirow{2}{*}{58.33\%} &  \multirow{2}{*}{\textbf{60.15\%}}  &  \multirow{2}{*}{\textbf{51.76\%}} \\     
\hline
\end{tabular}
\end{table}

\end{document}
share|improve this answer
    
I had tried this. It was this line: \multicolumn{1}{c|}{} which made the difference. Could you tell me what this does? –  Parag S. Chandakkar Jun 9 at 20:53
1  
@ParagS.Chandakkar it replaces the table default |c| template for that cell by c| so you get no vertical rule on the left. –  David Carlisle Jun 9 at 21:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.