# How to avoid cline overwride when using cellcolor? [duplicate]

The cline between the colored cells 1 and 2 in the example below has been overridden by the cellcolor command. I was wondering whether there exists a way to make the line separating these two cells on top of the yellow color. Any help is highly appreciated.

Thanks

Hartmut Helmut

\documentclass[a4paper,11pt]{article}

\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{multirow}

\begin{document}

\begin{center}
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|}\hline
Days  & 3 & 6 & 9 & 12 & 15 & 18 \\
\hline\hline
\multirow{2}{*}{Project} & \multicolumn{4}{c|}{\cellcolor{yellow} 1} & & \\
\cline{2-7}
& & & \multicolumn{4}{c|}{\cellcolor{yellow} 2}  \\
\hline
\end{tabular}
\end{table}
\end{center}

\end{document}

• please see the colortbl package documentation. \cline is explicitly not supported. You could use \hhline from the hhline package instead. – David Carlisle Sep 5 '17 at 8:40
• @Schweinebacke The question you referred to deals with \columncolor while here I have cellcolor – Daddy Sep 5 '17 at 9:09
• @HartmutHelmut these are the same thing (more or less) – David Carlisle Sep 5 '17 at 9:47

With hhline. B.t.w., don't nest your table environment in center, as it adds an unwanted supplementary vertical spacing. Use the directive \centering instead.

\documentclass[a4paper,11pt]{article}

\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{multirow, hhline}

\begin{document}

\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hhline{*{7}{-}}
Days & 3 & 6 & 9 & 12 & 15 & 18 \\
\hhline{*{7}{:=}:}
\multirow{2}{*}{Project} & \multicolumn{4}{c|}{\cellcolor{yellow} 1} & & \\
\hhline{|~|------|}
& & & \multicolumn{4}{c|}{\cellcolor{yellow} 2} \\
\hhline{*{7}{-}}
\end{tabular}
\end{table}

\end{document}