color multirow in a table

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{colortbl}
\usepackage{multicol}
\begin{document}
\begin{table}
\begin{tabular}{|l|c|c|c|c|}
\hline
\multicolumn{5}{|c|}{Type} \\
\hline
  & A  &    B & C & D \\
    \hline
    X & 53,2\%  &   51,6\%  & \cellcolor[gray]{0.9}  & \cellcolor[gray]{0.9}\\
    Y  & 53,8\%  &  52,2\%  & \multirow{-2}{*}{\cellcolor[gray]{.9}49\%} & \multirow{-2}{*}{\cellcolor[gray]{0.9}49\% }\\
\hline
\end{tabular}
\end{table}
\end{document}

enter image description here

First color the upper cells by issuing \cellcolor[gray]{0.9} and then use \multirow n the second row. Note -2 in \multirow{-2}{*}{...}. This will make multi row to grow upwards.

Tags:

Color

Tables