[Tex/LaTex] \cline is in tables too thin (when using coloured cells)

colortables

I'm having an issue where \cline appears to be drawn under the fill for table colours.

With \hline

enter image description here

With \cline

(to remove the line above the cell I want blank)

enter image description here

The line is still there, only very very thin. This doesn't always display or print. Is there anything simple I can do to fix this?

Here's the source for my example:

\documentclass{article}

\usepackage[table]{xcolor}

%odd/eaven colours for tables
\rowcolors{2}{gray!10}{white}

%to change cells of the title row 
\newcommand{\titlecol}{\cellcolor{gray!30}}

\begin{document}

\begin{table}[!ht]
\centering
\begin{tabular}{|l| c c | c c |}
\cline{2-5}
%\hline
\rowcolor{white} %first cell is excluded from the table
\multicolumn{1}{c|}{} & \multicolumn{2}{c|}{\titlecol Title1} & \multicolumn{2}{c|}{\titlecol Title2} \\
\hline
A & 0 & 1 & 2 & 3 \\
B & 0 & 1 & 2 & 3 \\
C & 0 & 1 & 2 & 3 \\
D & 0 & 1 & 2 & 3 \\
\hline
\end{tabular}
\caption{Caption.}
\label{mytable}
\end{table}

\end{document}

Best Answer

Thanks all for your answers and comments!

There's also this, now I know what to search for: Colored tables and cline/hhline

This is what I ended up with (using \hhline{~|--|--|}):

enter image description here

I've only looked briefly, but it looks like this is what the characters in hline do:

  • ~ no line for one cell
  • | the corner between horizontal and vertical lines, although I'm not sure if I needed the middle one
  • - the line for a cell

See the docs

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{hhline}

%odd/eaven colours for tables
\rowcolors{2}{gray!10}{white}

\newcommand{\titlecol}{\cellcolor{gray!30}}

\begin{document}

\begin{table}[!ht]
\centering
\begin{tabular}{|l| c c | c c |}
\hhline{~|*4{-}|}
%\cline{2-5}
%\hline
\rowcolor{white}
\multicolumn{1}{c|}{} & \multicolumn{2}{c|}{\titlecol Title1} & \multicolumn{2}{c|}{\titlecol Title2} \\
\hline
A & 0 & 1 & 2 & 3 \\
B & 0 & 1 & 2 & 3 \\
C & 0 & 1 & 2 & 3 \\
D & 0 & 1 & 2 & 3 \\
\hline
\end{tabular}
\caption{Caption.}
\label{mytable}
\end{table}

\end{document}