1

I'm using Miktex 2.9 and TexnicCenter 2.02 and I would like to have a gray column in my table. I found some examples on the internet. They work, but if I use them, some of the cell borders (only in the gray column) disappear in my PDF (Adobe Reader XI). On zoom level 100%, only the middle hline is gone, on zoom level 125% also the top line and on 150% (or 75%) also the left line of the gray column. On 90% the middle line is even there but top and left are missing. So it seemes to be random.

This is my latex table:

\usepackage{colortbl}
\definecolor{Gray}{gray}{0.85}
\newcolumntype{a}{>{\columncolor{Gray}}c}

\begin{document}
\begin{table}
\begin{tabular}{| a | l |} 
    \hline
    Spalte 1 & Spalte 2 \\
    \hline
    1 & 2 \\
    \hline
\end{tabular}
\end{table}
\end{document}

I also tried this alternative:

\begin{tabular}{|>{\columncolor[gray]{0.8}} l | r |}

Same problem here. I also found a similar question but with no answer and the comment, that a different viewer shoud be used. I tried it with PDF-XChange Viewer and actually the problem does not occur. But I know that my professor uses Adobe, so it has to work with this viewer. Does anyone got an idea? Thanks.

Edit: This \setlength\arrayrulewidth{0.6pt} or this \setlength\arrayrulewidth{1pt} does not solve the problem for me.

  • It's a feature. You can try increasing the rule width \setlength\arrayrulewidth{1pt} or some such but it's really a feature of the different pdf renderers and the way table colours are constructed in latex. – David Carlisle Aug 25 '15 at 14:07
  • 1
    It is not really random. Disappearing are the top and left lines - the one which are drawn before the color is added. The lines are much better if one redraw them after the color, but it can be rather time consuming. See e.g. tex.stackexchange.com/questions/134263/…. – Ulrike Fischer Aug 25 '15 at 14:29
  • @DavidCarlisle If I do this, the lines that would disappear show up normally (1pt thickness I guess) and the lines that wouldn't disappear are twice their thickness (2pt ?). But thank you. – Mackie Aug 25 '15 at 14:29
  • @UlrikeFischer Thanks, but same here. The lines are just thicker. But to be honest, I don't really understand the code, so maybe I did a mistake. – Mackie Aug 25 '15 at 14:39
  • 1
    I vote for this question to be reopended. The reason is, that the answer of the "original" question just doesn't solve the problem for me because I get these "pixel overlaps" and I find it very noticeable. Additionally I don't know how to draw the coloured panels before the tables, as suggested; or if I can use an alternative to the tabular syntax. I need more help here. – Mackie Sep 4 '15 at 13:53