1

I have a similar problem as in Remove white line in painted multirow tabular. Some PDF viewers like Adobe Reader and Evince display white lines inside my multirow cell.

thead/makecell doesn't work because I need to place the "Big Cell" at that exact position next to the three rows on the right. nicematrix sounds like a good solution, but unfortunately it's not available on my system (texlive2019).

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{tabularx}
\renewcommand{\arraystretch}{1.5}
\setlength\arrayrulewidth{1pt}

\newcommand{\cellgrey}[1]{\cellcolor{gray!40}{#1}}

\begin{document}

\renewcommand{\arraystretch}{2}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{tabularx}{\textwidth}{ |*{5}{Y|} }
    
    \hhline{|-|-|-|-|-|}
    
    \cellgrey{} & \cellgrey{1} & \cellgrey{2} & \cellgrey{3} & \cellgrey{4}\\
    \hhline{|*1{>{\arrayrulecolor{gray!40}}-}>{\arrayrulecolor{black}}|*4{-|}}

    \cellgrey{} & \cellgrey{5} & \cellgrey{6} & \cellgrey{7} & \cellgrey{8}\\
    \hhline{|*1{>{\arrayrulecolor{gray!40}}-}>{\arrayrulecolor{black}}|*4{-|}}
    
    \multirow{-3}{*}{\cellgrey{Big Cell}} & \cellgrey{9} & \cellgrey{10} & \cellgrey{11} & \cellgrey{12}\\
    \hhline{|-|-|-|-|-|}
    
\end{tabularx}
\renewcommand{\arraystretch}{1.2}

\end{document}

enter image description here

1
  • Welcome to TeX.SE. Any chance you could upgrade to TeXLive2022? The reason I ask is that I am unable to reproduce the issue you say you're getting on my fully updated MacTeX2022 system.
    – Mico
    Aug 30, 2022 at 17:16

1 Answer 1

1

This white lines seems tO be pdf viewer artifact. I can reproduce them with ma recent MiKTeX and Sumatra pdf viewer. However, using tabularray package, they disappear (the same will happen if you will use nicematrix package for setting of your table):

\documentclass{article}

\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}

\begin{tblr}{hlines=1pt, vlines=1pt,
             colspec = {*{5}{X[c]}},
             rowsep  = 5pt,
             rows    = {bg=gray!40}
             }
\SetCell[r=3]{c}    Big Cell
    & 1 & 2 & 3 & 4     \\
    & 1 & 2 & 3 & 4     \\
    & 1 & 2 & 3 & 4     \\
\end{tblr}

\end{document}

enter image description here

You must log in to answer this question.

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