[Tex/LaTex] Changing color in horizontal line in a table

tables

The following code

\documentclass[11pt]{article}
\usepackage[table]{xcolor}

\definecolor{orangec}{RGB}{255,158,62}

\newcommand{\wh}{\color{white}}

\begin{document}

\begin{tabular}{|l|l|l|}
\arrayrulecolor{orange}
\hline
\rowcolor{orange}\multicolumn{3}{|l|}{\wh\textit{\textbf{some}} \textbf{y} \textit{\textbf{any}}} \\ 
\multicolumn{3}{|l|}{Usamos some en oraciones afirmativas y any en oraciones} \\ 
\multicolumn{3}{|l|}{negativas y preguntas.} \\ 
\multicolumn{1}{!{\color{orange}\vline} l !{\color{white}\vline}}{\cellcolor{orange}} 
  & \multicolumn{1}{c !{\color{white}\vline}}{\cellcolor{orange}\color{white}\textbf{s.i.}} & \multicolumn{1}{c !{\color{orange}\vline}}{\cellcolor{orange}\color{white}\textbf{s.c.}}   \\ 
\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{afirmativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There's some beef.} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There are some eggs.}   \\
\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{negativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There isn't any beef.} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There aren't any eggs.}   \\
\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{interrogativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}Is there any beef?} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}Are there any eggs?}   \\
\hline
\end{tabular}

\end{document}

Gives

enter image description here

However I can't get white lines in the following image:

enter image description here

As you can see, those lines are orange-colored. I want them white. What's the way?

Best Answer

enter image description here

\documentclass[11pt]{article}
\usepackage{lmodern}
\usepackage[table]{xcolor}
\usepackage{hhline}

\definecolor{orangec}{RGB}{255,158,62}

\newcommand{\wh}{\color{white}}

\begin{document}
\sffamily

\setlength\arrayrulewidth{1pt}
\begin{tabular}{|l|l|l|}
\arrayrulecolor{orange}
\hline
\rowcolor{orange}\multicolumn{3}{|l|}{\wh\textit{\textbf{some y any}}} \\ 
\multicolumn{3}{|l|}{Usamos some en oraciones afirmativas y any en oraciones} \\ 
\multicolumn{3}{|l|}{negativas y preguntas.} \\ 
\multicolumn{1}{!{\color{orange}\vline} l !{\color{white}\vline}}{\cellcolor{orange}} 
  & \multicolumn{1}{c !{\color{white}\vline}}{\cellcolor{orange}\color{white}\textbf{s.i.}} & \multicolumn{1}{c !{\color{orange}\vline}}{\cellcolor{orange}\color{white}\textbf{s.c.}}   \\ 
\hhline{>{\arrayrulecolor{white}}->{\arrayrulecolor{orange}}--}%\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{afirmativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There's some beef.} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There are some eggs.}   \\
\hhline{>{\arrayrulecolor{white}}->{\arrayrulecolor{orange}}--}%\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{negativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There isn't any beef.} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}There aren't any eggs.}   \\
\hhline{>{\arrayrulecolor{white}}->{\arrayrulecolor{orange}}--}%\hline
\multicolumn{1}{!{\color{orange}\vline} l !{\color{orange}\vline}}{\cellcolor{orangec}\wh\textbf{interrogativo}} 
  & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}Is there any beef?} & \multicolumn{1}{l !{\color{orange}\vline}}{\cellcolor{white}Are there any eggs?}   \\
\hline
\end{tabular}

\end{document}

Using the hhline package you can easily control the colors of different segments of the \hline. I used the syntax,

\hhline{>{\arrayrulecolor{white}}->{\arrayrulecolor{orange}}--}

The number of dashes -> or -- after the specified color refer to the number of \clines with that color.

Note that I changed \arrayrulewidth to 1pt because PDFReader may show the rules very thin or unequal in thickness as it assumes that orange shading is more important than the white rules.

Related Question