[Tex/LaTex] how to decrease the space between the \toprule and the \rowcolor

colortables

I have a table

\begin{tabular}{ccc}\toprule
~&Jun-10&Jul-10\\\hline
Energy&19\%&7\% \\
LiveStock&2\%&-7\%   \\ \toprule
LiveStock&\cellcolor{red}{2\%}&\cellcolor{red}{-7\%}   \\
\hline
\end{tabular}

There is always some space between the toprule and the cellcolor, what should I do?

Best Answer

Something like this is the best i can get (using the link gonzalo provided)

\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs,colortbl,tabularx}

\begin{document}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\extrarowheight}{.75ex}

\begin{tabular}{ccc}\toprule
test & test & test\\\hline
test & test & test \\
test & test & test   \\ \toprule
test&\cellcolor{red}{test}&\cellcolor{red}{test}   \\
\hline
\end{tabular}

\end{document}
Related Question