改变表格中水平线的颜色

改变表格中水平线的颜色

下面的代码

\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}

给予

在此处输入图片描述

但是我在下图中找不到白线:

在此处输入图片描述

如您所见,这些线条是橙色的。我想要它们变成白色。有什么办法吗?

答案1

在此处输入图片描述

\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}

使用该hhline包,您可以轻松控制不同部分的颜色\hline。我使用了以下语法,

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

->指定颜色后的破折号或的数量指的是具有该颜色的 s--的数量。\cline

请注意,我将其更改\arrayrulewidth为,1pt因为 PDFReader 可能会显示非常细或粗细不均匀的规则,因为它假定橙色阴影比白色规则更重要。

相关内容