I'm new using latex and I want to do a colored table for my work. I have the following code:
\documentclass[11pt, oneside]{book}
\usepackage[table]{xcolor}
\usepackage{hhline}
\newcommand{\x}{\cellcolor[gray]{0.8}}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{colortbl}
\begin{document}
\begin{table}[h!]
\caption{List of proposed tasks \label{table_tasks}}
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\cline{3-8}
\multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & \multicolumn{3}{c|}{F1} & \multicolumn{3}{c|}{F2}\\
\cline{3-8}
\multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & A1 & A2 & A3 & B1 & B2 & B3\\
\hline
\multicolumn{1}{|c|}{\multirow{8}{*}{\rotatebox[origin=c]{90}{Year 1}}} & M &\x & \x & \x & & &\\
\cline{2-8}
& J &\x & \x & \x & & &\\
\cline{2-8}
& J &\x & \x & \x & & &\\
\cline{2-8}
& A & & & \x & & &\\
\cline{2-8}
& S & & & \x & & &\\
\cline{2-8}
& O & & & & \x & \x & \\
\cline{2-8}
& N & & & & \x & \x & \\
\cline{2-8}
& D & & & & \x & \x & \\
\hline
\multicolumn{1}{|c|}{\multirow{12}{*}{\rotatebox[origin=c]{90}{Year 2}}} & J & & & & \x & \x & \\
\cline{2-8}
& F & & & & \x & \x & \\
\cline{2-8}
& M & & & & & & \x \\
\cline{2-8}
& A & & & & & & \x \\
\cline{2-8}
& M & & & & & & \x \\
\cline{2-8}
& J & & & & & & \x \\
\cline{2-8}
& J & & & & & & \x \\
\cline{2-8}
& A & & & & & & \x \\
\cline{2-8}
& S & & & & & & \x \\
\cline{2-8}
& O & & & & & & \x \\
\cline{2-8}
& N & & & & & & \x \\
\cline{2-8}
& D & & & & & & \x \\
\cline{2-8}
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
The problem is when I use \cellcolor, color overwrites the table borders. What should I do to fix this problem? I would try using \hhline, but I don't understand the command when I want to color between two or more cells. Thanks in advance
\clineshould not be used with coloured tables, it will be obscured by the coloured panels. – David Carlisle May 01 '17 at 07:59