# How to change line color in tabular?

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.

-
–  Werner Jan 10 '12 at 16:47
yes, the answer is there :) –  nicolas roy Jan 10 '12 at 19:08

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:

-
Or the xcolor package with the table option (internally loading colortbl and giving access to the full xcolor capacity). –  Gonzalo Medina Jan 10 '12 at 16:08
the command \arrayrulecolor{red} is exactly what i need. –  nicolas roy Jan 10 '12 at 19:09

The tabu package could also be helpful here.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{tabu}

\begin{document}
\taburulecolor{blue}
\begin{tabu}{c|c|c}
a & b & c \\ \hline
d & e & f \\ \hline
g & h & i
\end{tabu}
\end{document}

-
i voted for wh1t3's solution, because, i need this in a very long document, with many tabular that are already written, and i don't want to change the environment. But the package tabu seems looks very interesting. Thank you –  nicolas roy Jan 10 '12 at 19:11
@nicolasroy: You can still upvote Thorsten's answer as well of course. –  Roelof Spijker Jan 10 '12 at 19:36
i've have been fighting in understanding how ot officially registerd in this forum... precisely with this purpose :) –  nicolas roy Jan 10 '12 at 20:01
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9993220567703247, "perplexity": 3227.9756902971535}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-15/segments/1397609539447.23/warc/CC-MAIN-20140416005219-00136-ip-10-147-4-33.ec2.internal.warc.gz"}