I have a table with color in the rows. When the first or last column is colored as shown below, there is an ugly white space before or after the cell. I want to remove this white space (in this picture, it only appears in the first row as it is the colored one. But the same thing applies when the last row is colored. I do not want this space in both the first and last rows).
Here is the script:
%README: this copy with comprehensive attack and defences description.
\documentclass[compsoc, conference, letterpaper, 10pt, times]{IEEEtran}
\ifCLASSOPTIONcompsoc
% IEEE Computer Society needs nocompress option
% requires cite.sty v4.0 or later (November 2003)
\usepackage[nocompress]{cite}
\else
% normal IEEE
\usepackage{cite}
\fi
\ifCLASSINFOpdf
\else
\fi
\usepackage{colortbl}
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand*\rot{\rotatebox{90}}
\usepackage{tabularx}
\usepackage{msc}
\usepackage{xcolor}
\newcommand{\quotes}[1]{``#1''} %for qoutation marks
\DeclareRobustCommand*{\IEEEauthorrefmark}[1]{%
\raisebox{0pt}[0pt][0pt]{\textsuperscript{\footnotesize\ensuremath{#1}}}}
\begin{document}
\title{Test}
\maketitle
\begin{table}
\caption{mytable}
\label{table:mytable}
\begin{tabular}{ l *{45}{c} }
\toprule
& \multicolumn{3}{c}{B} \\
\cmidrule(lr){2-4}
\multicolumn{1}{c}{\multirow{-2}{*}[0.5ex]{A}}
& AAA & BBB & CCC \\
\midrule
\rowcolor[gray]{.9}
Text1 & \cmark & \cmark & \cmark \\
Text2 & \xmark & \cmark & \xmark \\
\rowcolor[gray]{.9}
Text3 & \cmark & \xmark & \xmark \\
Text4 & \cmark & \cmark & \cmark \\
\bottomrule
\end{tabular}
\end{table}
\end{document}







