How to Remove Horizontal Lines From Colored Multirow Table [duplicate]

I am having some trouble removing the "white lines" from a colored table (where it says 3 and 4).

\documentclass{report}

\usepackage{wrapfig}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{hhline}
\usepackage[table,xcdraw]{xcolor}
\usepackage{graphicx}

\definecolor{lightgray}{rgb}{0.75,0.75,0.75}
\definecolor{darkgray}{rgb} {0.50,0.50,0.50}

\begin{document}
\begin{wraptable}[12]{r}[0cm]{5cm}
\vspace{-1cm}
\resizebox{5cm}{!}{
\begin{tabular}{c|c|c}
\hline
\textbf{Binary}    & \textbf{ICDR}      & \textbf{ETDRS}                                             \\ \hline
0                  & 0                  & No DR                                                      \\ \hline
&\cellcolor{lightgray}1                   & \cellcolor{lightgray}Very mild NPDR   \\ \hhline{~|--}
&\cellcolor{lightgray}2                   & \cellcolor{lightgray}Mild NPDR        \\ \hhline{~|--}
&\cellcolor{lightgray}                    & \cellcolor{lightgray}Moderate NPDR    \\ \hhline{~~|-}
&\cellcolor{lightgray}                    & \cellcolor{lightgray}Severe NPDR      \\ \hhline{~~|-}
&\cellcolor{lightgray}\multirow{-3}{*}{3} & \cellcolor{lightgray}Very Severe NPDR \\ \hhline{~|--}
&\cellcolor{darkgray}                     & \cellcolor{darkgray}\begin{tabular}[c]{@{}c@{}}Mild - Moderate\\ PDR\end{tabular}          \\ \hhline{~~|-}
&\cellcolor{darkgray}                     & \cellcolor{darkgray}High-Risk PDR                                                          \\ \hhline{~~|-}
\multirow{-8}{*}{1}&\cellcolor{darkgray} \multirow{-3}{*}{4} & \cellcolor{darkgray}\begin{tabular}[c]{@{}c@{}}Advanced Diabetic\\ Eye Disease\end{tabular}\\ \hhline{---}
\end{tabular}}
\caption{\label{tab:dr_classes}Sample Caption.}
\end{wraptable}]

\end{document}


Any information is appreciated.

• Please complete the code with documentclass and packages. The code is not compilable. – subham soni Feb 20 at 8:06
• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Stefan Pinnow Feb 20 at 8:11
• Apologies & thanks for the reminder. Code should be compilable now. – TexLover Feb 20 at 8:28
• The document class might be relevant but you don't have a \documentclass command so the supplied code can't possibly compile. – Andrew Feb 20 at 8:29
• Why not use \cline{3-3} instead of the \hhline? With \cline there are no white lines in the adjacent multirow cell. – leandriis Feb 20 at 9:49

i would redesign your table as follows:

\documentclass{report}

\usepackage{wrapfig}
\usepackage{array, booktabs, multirow}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage[table,xcdraw]{xcolor}
\definecolor{lightgray}{rgb}{0.75,0.75,0.75}
\definecolor{darkgray}{rgb} {0.50,0.50,0.50}
\usepackage{hhline}
\newcommand\lightline{%
\hhline{~|>{\arrayrulecolor{lightgray}}-%
>{\arrayrulecolor{black}}|-}%
}
\newcommand\darkline{%
\hhline{~|>{\arrayrulecolor{gray}}-%
>{\arrayrulecolor{black}}|-}%
}

\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{wraptable}[12]{r}[0cm]{5cm}
\setlength\tabcolsep{0pt}
\footnotesize
\vspace{-\baselineskip}
\begin{tabular}{      C{\dimexpr0.22\linewidth-0.66\arrayrulewidth}|@{}
>{\columncolor{lightgray}}C{\dimexpr0.21\linewidth-0.66\arrayrulewidth}|
>{\columncolor{lightgray}}C{\dimexpr0.57\linewidth-0.66\arrayrulewidth}
}
\hhline{---}
\rowcolor{white}
\textbf{Binary}
& \textbf{ICDR}
& \textbf{ETDRS}        \\ \hhline{---}
\rowcolor{white}
0   & 0 & No DR                 \\ \hhline{---}
& 1 & Very mild NPDR        \\ \hhline{~|-|-}
& 2 & Mild NPDR             \\ \hhline{~|-|-}
&   & Moderate NPDR         \\ \lightline
&   & Severe NPDR           \\ \lightline
\multirow{2}{*}{1}
& \multirow{-3}{*}{3}
& Very Severe NPDR      \\
\end{tabular}\\[-1pt]
\begin{tabular}{     C{\dimexpr0.22\linewidth-0.66\arrayrulewidth}|
>{\columncolor{darkgray}}C{\dimexpr0.21\linewidth-0.66\arrayrulewidth}|
>{\columncolor{darkgray}}C{\dimexpr0.57\linewidth-0.66\arrayrulewidth}
}
\hhline{~|-|-}
&   & Mild - Moderate PD    \\ \darkline
&   & High-Risk PDR         \\ \darkline
& \multirow{-2}{*}{4}
Eye Disease           \\ \hhline{---}
\end{tabular}
\caption{Sample Caption.}
\label{tab:dr_classes}
\end{wraptable}
\lipsum[2]
\end{document}


still visible white lines are caused by artifacts of pdf previewer (i use sumatra). it should not be visible in printed document.

• Playing with arrayrulecolor sounds like a really good idea, however the results seem to be the same. Is there a way to limit the size of the colored cell so that it doesn't write over the lines? So that we can use \cline instead of \hhline, which works correctly without color. – TexLover Feb 20 at 23:09
• Marking this as an answer until someone comes up with a perfect solution. Seems to be the same problem as this one: tex.stackexchange.com/a/65235/181958 – TexLover Feb 20 at 23:14
• there is no better answer with your colors. try to replace your colors with gray and white, you will see, that artifacts will gone. you can ask author of colortbl package for help. and don't accept my answer if it is not good. – Zarko Feb 20 at 23:28
• Compared side to side, your answer improves it a lot. Thank you for that. And like you've said there doesn't seem to be any other option currently. Maybe tikz package could help: tex.stackexchange.com/a/409657/181958 adjustbox didn't solve the problem. So yours is the best currently. – TexLover Feb 20 at 23:36