Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
3  
See Alan's answer to Coloring columns in a table with colortbl and booktabs. –  Gonzalo Medina Jun 8 '11 at 1:44
add comment

1 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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.