7

how to make some border lines of a table thick and colored (either vertical lines or horizental lines)?I tried Xcline but could not color it. Also I tried make the cline thick but failed.

2
  • 2
    Please post a minimal working example (MWE) of what you have tried.
    – CarLaTeX
    Sep 15, 2017 at 4:04
  • 1
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). Sep 15, 2017 at 5:13

1 Answer 1

17

enter image description here

\documentclass{article}

\usepackage{hhline,colortbl}

\begin{document}
\arrayrulecolor{green}

\begin{tabular}{
 !{\color{red}\vrule width 2pt}
 l
 |
 c
 !{\color{blue}\vrule width 2pt}
 c
 ||
}
 one & two & three\\
\hline
  1 & 2 & 3\\%
\noalign{
\color{yellow}
\hrule height 5pt
}%
4&5&6\\
\hline
\end{tabular}
\end{document}
5
  • 1
    As usual I'm impressed by your answer. I also hope that the example was meant to discourage the questioner's design idea. Sep 15, 2017 at 17:44
  • 6
    @PeterWilson oh now I'm hurt, I thought it was an example of a pinnacle of typographic design:( Sep 15, 2017 at 18:27
  • Further, How to just make parts of border lines thick and colored.
    – alex
    Sep 18, 2017 at 4:30
  • If I'm trying to color the last line of the table using the same syntax, the red vertical line goes beyond the last horizontal line. How can I solve it ?
    – 3isenHeim
    Nov 26, 2019 at 7:13
  • 1
    @EisenHeim please don't ask new questions as comments on old answers, that means you have an error somewhere, perhaps you have \\ after the line. Nov 26, 2019 at 7:53

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.