# Displaying the horizontal and vertical lines of a table after coloring rows

How can I re-show each line in the following table after coloring the row?

 \documentclass[english,a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[latin9]{inputenc}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage[showframe=false]{geometry}
\usepackage{changepage}
\usepackage{hhline}

\usepackage[font=normalsize,labelfont=bf,justification=centering]{caption}
\begin{document}

\begin{table}[htb]
\resizebox{0.6\textwidth}{!}{
\begin{minipage}{\linewidth}
\def\arraystretch{1.5}%

\begin{tabular}{ | c | c | c | c | c |  c |  c |  c | c |  c |  c |  }
\cline{2-11}

\hline
\textbf{LOC} & 5 & 5 & 6 & 5 & - & 5 & 6 & 5 & 6 & 5  \\
\hline
\rowcolor{gray!40}  \textbf{VS} & 8 & 5 & 9 & 8 & 9 & 8 & 9 & 8 & 9 & 8 \\
\hline

\end{tabular}
\end{minipage}
}
%% put caption outside here
\caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}
\end{table}
\end{document}


• Can you elaborate your question please? What do you mean by re-showing the lines? – user11232 Mar 30 '14 at 22:33
• As image indicates, some vertical and horizontal lines do not show after making \rowcolor in one row. I clearly want to display these missing parts again. – Hakan Mar 30 '14 at 22:38
• It is an issue with the pdf viewer. If you print them, they should be visible. If you magnify then you will see the difference. – user11232 Mar 30 '14 at 22:42
• If you can sacrifice vertical lines (which you should if you want a good table) then you can use booktabs where these are distinctly visible. If you want I will provide some code. – user11232 Mar 30 '14 at 22:43
• hmm after mignifying around %400 in FoxitReader and Adobe still I can not see properly vertical lines :/. Could you show an alternative way for this? – Hakan Mar 30 '14 at 22:45

One way is to increase the width of the lines by

\setlength\arrayrulewidth{1pt}


Code:

 \documentclass[english,a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[latin9]{inputenc}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage[showframe=false]{geometry}
\usepackage{changepage}
\usepackage{hhline}

\usepackage[font=normalsize,labelfont=bf,justification=centering]{caption}
\begin{document}

\begin{table}[htb]
\setlength\arrayrulewidth{1pt}        %% put it inside table environment so that change is local
\resizebox{0.6\textwidth}{!}{
\begin{minipage}{\linewidth}
\def\arraystretch{1.5}%

\begin{tabular}{ | c | c | c | c | c |  c |  c |  c | c |  c |  c |  }
\cline{2-11}

\hline
\textbf{LOC} & 5 & 5 & 6 & 5 & - & 5 & 6 & 5 & 6 & 5  \\
\hline
\rowcolor{gray!40}  \textbf{VS} & 8 & 5 & 9 & 8 & 9 & 8 & 9 & 8 & 9 & 8 \\
\hline

\end{tabular}
\end{minipage}
}
%% put caption outside here
\caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}
\end{table}
\end{document}


Your tables become more readable and beautiful if you get rid of vertical lines and some of the horizontal lines (you need only three of them, two at the top and one at the bottom). We do this with booktabs package (whose documentation explains some good practices about writing tables)

 \documentclass[english,a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[latin9]{inputenc}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage[showframe=false]{geometry}
\usepackage{changepage}
\usepackage{hhline}
\usepackage{booktabs}

\usepackage[font=normalsize,labelfont=bf,justification=centering]{caption}
\begin{document}

\begin{table}[htb]
\resizebox{0.6\textwidth}{!}{
\begin{minipage}{\linewidth}
\def\arraystretch{1.5}%

\begin{tabular}{ *{11}{c}}
\\\toprule

\midrule
\textbf{LOC} & 5 & 5 & 6 & 5 & - & 5 & 6 & 5 & 6 & 5  \\
\rowcolor{gray!40}  \textbf{VS} & 8 & 5 & 9 & 8 & 9 & 8 & 9 & 8 & 9 & 8 \\
\bottomrule

\end{tabular}
\end{minipage}
}

• @Hakan What do you mean? But the command \arrayruleheight doesn't exist. I think \arrayrulewidth is enough. Change the value appropriately. – user11232 Mar 30 '14 at 23:00