# Coloring blind spot case with alternate table row colors

Enthusiastically using the alternate table row coloring feature in xcolor (which I discovered here on TeXSE, as many more most useful things), I stumbled on an annoying phenomenon: the code

\documentclass{amsart}

\usepackage[table]{xcolor}

\rowcolors{2}{gray!10}{white}

\begin{document}
\begin{tabular}{l|r}
\hline
\hline
cell&cell\\
\hline
L\hfill R&cell\\
\hline
cell&cell\\
\hline
cell&cell\\
cell&cell
\end{tabular}
\end{document}


produces

That annoying blind spot is, doubtlessly, caused by the \hfill, but why? Can I get rid of it? I don't mind splitting that particular cell into two if you tell me how. Making extra column is not an option since I only need it occasionally in very few cells.

If you use fill glue the total must be 0fill see the paragraph at the top of page 10 of texdoc colortbl.

\documentclass{amsart}

\usepackage[table]{xcolor}

\rowcolors{2}{gray!10}{white}

\begin{document}
\begin{tabular}{l|r}
\hline
\hline
cell&cell\\
\hline
L\hfill R\hspace{-\fill}\mbox{}&cell\\
\hline
cell&cell\\
\hline
cell&cell\\
cell&cell
\end{tabular}
\end{document}


Here is a way to construct that table with {NiceTabular} of nicematrix.

You will have a perfect ouput in the PDF viewers. The rules won't seem to vanish in some PDF viewers (such as Adobe Reader) as some levels of zoom.

\documentclass{amsart}
\usepackage{nicematrix}

\begin{document}
\begin{NiceTabular}{l|r}
\CodeBefore
\rowcolors{2}{gray!10}{}
\Body
\hline
\hline
cell&cell\\
\hline
L \Block[r]{}{R}&cell\\
\hline
cell&cell\\
\hline
cell&cell\\
cell&cell
\end{NiceTabular}
\end{document}


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

Try to put

\begin{tabular}{@{}ll@{}}L&R\end{tabular}


Instead of the cell with \hfill (you can build a macro easily)