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.

Whenever I use the colortbl package to format tables, a thin white space between the cells sometimes shows up on screen (not in print for as far as I can tell). For example in this table:

Is there an easy way to enlarge each rectangle by a tiny amount so that the white space is not visible anymore?

(My guess is that the white space appears due to rounding in my pdf viewer, evince. I don't know if other pdf viewers have the same issue. Regardless, I would like to have my pdf file look good in common pdf readers)

share|improve this question

1 Answer 1

up vote 9 down vote accepted

Yes this is due to the coloured panels being snapped to pixel boundaries.

You can go \\\noalign{\vskip-0.1pt} for a suitably small amount between each row, then the panels will overlap and you are less likely to get a gap. You can add set \extrarowheight to something large to compensate (which is probably a good idea anyway, to keep the capital letters away from the top of the panels)

That is for horizontal lines. For vertical lines \rowcolor has optional arguments to specify optional left and right overhang.

share|improve this answer
1  
Awesome, works like a charm! Maybe this could be default behavior of colortbl? –  Yori Apr 27 '12 at 14:51
    
Can't really make it the default, it's inherent in the way TeX handles color really, a "small" overlap between tow large panels isn't noticeable but if you have a 0.4pt \hline between them overlapping by 0.1pt is probably too much. You can get the same behaviour without colortbl just use something like \fcolorbox Tex will specify that the coloured panel and the border are adjacent but some viewers my snap them apart by a pixel. –  David Carlisle Apr 27 '12 at 15:43
1  
I see. Perhaps a length parameter could be added to the colortbl package, which can be set by the user to enlarge each background by a small overlap? –  Yori Apr 27 '12 at 16:32
    
yes that's a possibility, I'll think about it... –  David Carlisle Apr 27 '12 at 18:33

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.