4

I have seen a similar problem, but none of what I have found thus far helps me... I have a pretty complicated table (I have adapted from another source, so I cannot really change the structure), and I cannot get the thin white lines out of the multirow cells. The real table is larger, but here is enough of a sample to show the issue:

\usepackage[table,svgnames,xcdraw]{xcolor}
\usepackage{array, colortbl, multirow, graphicx}
\begin{table}[]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{llccccc}
\rowcolor[HTML]{000000} 
\multicolumn{2}{c|}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} }} & 
\multicolumn{2}{c}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Volume (M)}} & \multicolumn{3}{c}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Cost Savings (\$M)}} \\ \cline{3-4}
\rowcolor[HTML]{000000} 
\multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Transaction Type}}} & {\color[HTML]{FFFFFF} Plans} & {\color[HTML]{FFFFFF} Providers} & {\color[HTML]{FFFFFF} Plans} & {\color[HTML]{FFFFFF} Providers} & {\color[HTML]{FFFFFF} Total} \\
\end{tabular}%
}

Look closely, you see thin white lines even through the text

So I obviously want those thin white lines, especially THROUGH the text, NOT to show up. Thank you in advance.

Edit: I see the thin white lines even when zoomed in, using either Preview or the builtin PDF viewing for TexShop on Mac OSX 10.12.4 If you click on the image in the original post, you can clearly see the white lines in the fully-zoomed image.

2
  • 1
    Do the lines still exist, if you zoom in? I think its a pdf-viewer problem.
    – Bobyandbob
    Jul 17, 2017 at 5:12
  • 1
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. ( I moved your answer/comment to your question)
    – Bobyandbob
    Jul 17, 2017 at 5:56

2 Answers 2

2

For the vertical line you can try to add a bit more (e.g. 0.1pt) to the default overhang, so that the colors overlap. For the horizontal lines moving the second line a bit up can help. Be aware that this can affect lines between the tabulars.

\documentclass{scrartcl}
\usepackage[table,svgnames,xcdraw]{xcolor}
\usepackage{array, colortbl, multirow, graphicx}

\begin{document}
\begin{table}[]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{llccccc}
\rowcolor[HTML]{000000}[\dimexpr\tabcolsep+0.1pt\relax] %overhang
\multicolumn{2}{c|}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} }} &
\multicolumn{2}{c}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Volume (M)}} & \multicolumn{3}{c}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Cost Savings (\$M)}} \\[-0.1pt] \cline{3-4} % a bit up
\rowcolor[HTML]{000000}[\dimexpr\tabcolsep+0.1pt\relax] %overhang
\multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{000000}{\color[HTML]{FFFFFF} Transaction Type}}} & {\color[HTML]{FFFFFF} Plans} & {\color[HTML]{FFFFFF} Providers} & {\color[HTML]{FFFFFF} Plans} & {\color[HTML]{FFFFFF} Providers} & {\color[HTML]{FFFFFF} Total} \\
\end{tabular}%
}
\end{table}
\end{document}

For really perfect colors I normally use tikz like in this example Background colour for cells with padding

1
  • thank you, this is close... although in the more complete version of my table (with additional multirows), this doesn't work consistently. i will look into trying to make tikz work per your suggestion. thanks again! Jul 18, 2017 at 17:00
0

The thin white lines occur in some PDF engines (e.g. muPDF which is used in SumatraPDF for instance) when two adjacent cells are colored with two distinct instructions fill (the operator fill of PostScript which is called f in the PDF streams).

With colortbl, each cell is colored with its own instruction fill even when \columncolor or \rowcolor is used.

The package nicematrix provides tools to face that problem. In the environment {NiceTabular} provided by that package, some PGF/Tikz nodes are created under the array and used to draw the rules and color the cells. Hence, in your case, you have only a rectangle to fill (with only one instruction fill).

\documentclass{article}
\usepackage{nicematrix}
\begin{document}

\begin{center}
\color{white}
\begin{NiceTabular}{cccccc}
\CodeBefore
  \arraycolor{black}
\Body
  \Block{2-1}{Transaction Type}
  & \Block{1-2}{Volume (M)} &           & \Block{1-3}{Cost Savings (\$M)} \\ 
  & Plans                   & Providers & Plans  & Providers & Total      \\
\end{NiceTabular}
\end{center}

\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .