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

a&b&c \\ \hline
d&e&f \\ \hline

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


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

    test & test\\\arrayrulecolor{blue}\hline

Looks like this:

Array with coloured rules

  • 19
    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
  • 2
    the command \arrayrulecolor{red} is exactly what i need. – Loic Rosnay Jan 10 '12 at 19:09
  • 1
    Note that the arrayrulecolor command also applies to the \toprule, \midrule and \bottomrule commands defined in the booktabs package. – ph0t0nix May 18 '16 at 9:03
  • 1
    How do you reset this to the default color afterward? I am guessing that the default is usually black, but I am not sure. – Randy Cragun Jul 21 '19 at 20:52
  • @RandyCragun Have you found out? – Clément Oct 18 '19 at 16:14

The tabu package could also be helpful here.


    a & b & c \\ \hline
    d & e & f \\ \hline
    g & h & i
  • 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 – Loic Rosnay Jan 10 '12 at 19:11
  • 2
    @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 :) – Loic Rosnay Jan 10 '12 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.