[Tex/LaTex] Displaying the horizontal and vertical lines of a table after coloring rows

colorcolortbltables

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]
\begin{adjustwidth}{-1cm}{}
\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}
\multicolumn{1}{c|}{} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} \\

\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} 
}
\end{adjustwidth}
%% put caption outside here
\caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}
\end{table}
\end{document}

enter image description here

Best Answer

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
\begin{adjustwidth}{-1cm}{}
\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}
\multicolumn{1}{c|}{} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} \\

\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}
}
\end{adjustwidth}
%% put caption outside here
\caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}
\end{table}
\end{document}

enter image description here

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]
\begin{adjustwidth}{-1cm}{}
\resizebox{0.6\textwidth}{!}{
\begin{minipage}{\linewidth}
\def\arraystretch{1.5}%

\begin{tabular}{ *{11}{c}}
\\\toprule
                    & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &
\textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} \\

\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}
}
\end{adjustwidth}
%% put caption outside here
\caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}
\end{table}
\end{document}

enter image description here

Related Question