How to change color of hline in LaTex
17,109
You need to use colortbl
to colour the default tabular
rules (horizontal or vertical):
\documentclass{article}
\usepackage{colortbl}
\begin{document}
\begin{tabular}{c}
\arrayrulecolor{red}\hline
a \\
\arrayrulecolor{green}\hline
\end{tabular}
\end{document}
Author by
JonathanSFL
Updated on June 20, 2022Comments
-
JonathanSFL almost 2 years
In a simple latex .tex file, how can i colorize an
hline
?I've tried
\hline[color:red]
...and:
\hline{color:red}
...but they don't work
Similarly, how can i increase the thickness (width) of the
hline
?-
kdauria about 8 yearsDuplicate of tex.stackexchange.com/questions/40666/…
-
-
Maxim Pontyushenko almost 9 yearsCan you make more detailed response by showing some code or what you did step-by-step?
-
dgilperez over 8 yearsI'm seeing this error (although the file compiles):
Misplaced \noalign. \hline ->\noalign
. [...]I expect to see \noalign only after the \cr of an alignment. Proceed, and I'll ignore this case.