0

I am using the following latex code to highlight some row of a table useing rowcolor command. However the table borders in those rows are overwritten by the row color. Why is it happening? How can I solve this?

Thanks

code

%% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage[table]{xcolor}
\definecolor{gray}{cmyk}{0,0,0,0.17}
\begin{table}[h]
\centering
\begin{tabular}{| c | c | c | c |}
\hline
User & Action & Time \\ \hline
\rowcolor{gray} $A$ & $a_{1}$ & 1 \\ \hline
\rowcolor{gray} $B$ & $a_{1}$ & 2 \\ \hline
\rowcolor{gray} $A$ & $a_{2}$ & 2 \\ \hline
\rowcolor{gray} $C$ & $a_{1}$ & 4 \\ \hline
\rowcolor{gray} $B$ & $a_{2}$ & 4 \\ \hline
$C$ & $a_{2}$ & 5 \\ \hline
$D$ & $a_{2}$ & 8 \\ \hline
$E$ & $a_{1}$ & 8 \\ \hline
\end{tabular}
\caption{Action Log}
\end{table}
\end{document}

Output: enter image description here

Using midrule enter image description here

0 Answers0