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}
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}
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}
Creates white lines on the left column.
Is there any possible way on how to resolve this?