0
\documentclass[a4paper]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{colortbl}
\usepackage{etoolbox}
\usepackage{hhline}

%--------------------------------------------------------%
%   BEGIN DOCUMENT
%--------------------------------------------------------%

\begin{document}
\begin{table}[]
\centering
\caption{Fruits!}\tabularnewline
\label{my-label}
\begin{tabular}{|c|c|c|c|c|}\hline
\multicolumn{5}{|c|}{\textbf{Fruits}}                                                                                 \\ \hline
     & \multicolumn{2}{c|}{Billy}                          & \multicolumn{2}{c|}{Jean}                     \\ \hline
Rank & Item                                             & Weight & Item                                      & Weight \\ \hline
\rowcolor[gray]{.9} 1    & Apples.         & 0.331  & Oranges.  & 0.423  \\
2    & Bananas.        & 0.170  & Strawberries. & 0.423  \\
\end{tabular}
\end{table}
%--------------------------------------------------------%
%   END DOCUMENT
%--------------------------------------------------------%

\end{document}

I'm using \rowcolor to color in certain rows of my table, but I notice that this causes some of the vertical borders to be covered. I've tried using the package hhline but it doesn't seem to help.

enter image description here

Adrian
  • 471
  • This is viewer-dependent. Here's a view under Sumatra (no problem). – Werner Mar 24 '16 at 00:52
  • By Sumatra do you mean SumatraPDF? I've been using the web latex tool called Overleaf...what could be causing one viewer to show the border but the other doesn't? – Adrian Mar 24 '16 at 01:02
  • ...the rendering algorithm, as well as the zoom resolution. When you zoom in to a high level in the resulting PDF, I'm guessing the output will show vertical rules everywhere, just like it does between Item and Weight. You can increase the rule width by adding \usepackage{array} \setlength{\arrayrulewidth}{2pt}. We have a similar question about this somewhere else... – Werner Mar 24 '16 at 01:09

0 Answers0