[Tex/LaTex] Cellcolor overwrites partial horizontal lines (\cline)

colortblmultirowtables

So I need to make a colored table with multirows, together with the use of partial horizontal lines. I used \cline which does not work: the \cellcolor-command overwrites the line. This question told me to change it to \hhline which will not be overwritten by \cellcolor. Instead, \hhline overwrites the color.

To make it more clear:

Without color:

\documentclass{article}

\usepackage{colortbl}
\usepackage{multirow}

\begin{document}

  \begin{tabular}{|c|c|}
    \hline
    \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
    First data & 932\\ \hline
     & 239\\ \cline{2-2}  % or \hhline{|~|-|}
     & 137\\ \cline{2-2}  % or \hhline{|~|-|}
    \multirow{-3}{*}{More data} & 319\\ \hline
    Last data & 132\\ \hline
  \end{tabular}

\end{document}

Using <code>\cline</code> without color

With color:
Using \cline

\documentclass{article}

\usepackage{colortbl}
\usepackage{multirow}

\begin{document}

  \begin{tabular}{|>{\columncolor{red}}c|>{\columncolor{blue}}c|}
    \hline
    \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
    First data & 932\\ \hline
     & 239\\ \cline{2-2}
     & 137\\ \cline{2-2}
    \multirow{-3}{*}{More data} & 319\\ \hline
    Last data & 132\\ \hline
  \end{tabular}

\end{document}

enter image description here
Makes the lines in the right column disappear.

Using \hhline

\documentclass{article}

\usepackage{colortbl}
\usepackage{multirow}
\usepackage{hhline}

\begin{document}

  \begin{tabular}{|>{\columncolor{red}}c|>{\columncolor{blue}}c|}
    \hline
    \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
    First data & 932\\ \hline
     & 239\\ \hhline{|~|-|}
     & 137\\ \hhline{|~|-|}
    \multirow{-3}{*}{More data} & 319\\ \hline
    Last data & 132\\ \hline
  \end{tabular}

\end{document}

enter image description here
Creates white lines on the left column.

Is there any possible way on how to resolve this?

Best Answer

I'm sorry the interface is not brilliant here: But you can do this:

\documentclass{article}

\usepackage{colortbl}
\usepackage{multirow}
\usepackage{hhline}

\begin{document}

  \begin{tabular}{|>{\columncolor{red}}c|>{\columncolor{blue}}c|}
    \hline
    \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
    First data & 932\\ \hline
     & 239\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
     & 137\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
    \multirow{-3}{*}{More data} & 319\\ \hline
    Last data & 132\\ \hline
  \end{tabular}

\end{document}

Result:

enter image description here

Related Question