[Tex/LaTex] How to change line color in tabular

colorrulestables

How can I change the color of the lines (the frame) in a tabular environment? In the following MWE:

\begin{tabular}{c|c|c}
a&b&c \\ \hline
d&e&f \\ \hline
g&h&i
\end{tabular}

I would like the horizontal and vertical lines of the table to have, say a blue color.

Best Answer

You can use the colortbl package for this. It works as follows:

\documentclass{article}
\usepackage{colortbl}
\begin{document}
  \begin{tabular}{l!{\color{green}\vrule}l}
    \arrayrulecolor{red}\hline
    test & test\\\arrayrulecolor{blue}\hline
  \end{tabular}
\end{document}

Looks like this:

Array with coloured rules

Related Question