hhline mudanças de cor da linha vertical

hhline mudanças de cor da linha vertical

Como alterar a parte destacada da linha vertical para preto ou cor diferente de cada linha vertical na célula usando hhline? Encontre o arquivo MWE:

insira a descrição da imagem aqui

\documentclass{book}
\usepackage{colortbl}
\usepackage{array}
\usepackage{hhline}
\usepackage{ragged2e}
\usepackage[draft]{hyperref}
\usepackage{tabu}

\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash\hspace{0pt}}p{#1}}%\hangindent6pt

\begin{document}

\begin{tabu}{|L{50pt}|L{50pt}|L{50pt}|L{50pt}|L{50pt}|L{50pt}|}
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
\hhline{>{\arrayrulecolor{blue}}=>{\arrayrulecolor{red}}=>{\arrayrulecolor{yellow}}=>{\arrayrulecolor{green}}==>{\arrayrulecolor{red}}=}
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
%\hhline{|||||>{\arrayrulecolor{blue}}=|||||>{\arrayrulecolor{white}}|>{\arrayrulecolor{black}}|>{\arrayrulecolor{red}}=>{\arrayrulecolor{yellow}}=>{\arrayrulecolor{green}}===}
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
\hhline{|>{\arrayrulecolor{blue}}=|>{\arrayrulecolor{red}}=|>{\arrayrulecolor{blue}}=|>{\arrayrulecolor{red}}=|>{\arrayrulecolor{blue}}=|>{\arrayrulecolor{red}}=|}
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
%\hhline{>{\arrayrulecolor{black}}~~>{\arrayrulewidth3pt}=~~}
Sample 1 &Sample 2 &Sample 3 &Sample 4 &Sample 5&Sample 6\\
\end{tabu}

\end{document}

Responder1

O >{\arrayrulecolor{<color>}}pode ser usado antes de preâmbulos tabulares vline como |.

No exemplo a seguir, defino todas as três vlines em amarelo.

\documentclass{book}
\usepackage{colortbl}
\usepackage{hhline}

\begin{document}
\setlength{\arrayrulewidth}{2pt} % to highlight array rules

\begin{tabular}{|c|c|}
  \hline
  a & b \\ \hline
  c & d \\ 
    % set all three vlines in yellow
    \hhline{
      >{\arrayrulecolor{yellow}} | 
      >{\arrayrulecolor{red}}    =
      >{\arrayrulecolor{yellow}} |
      >{\arrayrulecolor{cyan}}   =
      >{\arrayrulecolor{yellow}} |
      >{\arrayrulecolor{black}}
    }
  e & f \\ \hline
\end{tabular}
\end{document}

insira a descrição da imagem aqui

informação relacionada