I have created a table using tabularx. Can I color the \midrule instead of having it colored black as default?
Asked
Active
Viewed 5,990 times
4
Jamgreen
- 3,687
1 Answers
11
Something like this?

\documentclass{article}
\usepackage{booktabs,tabularx, colortbl}
\begin{document}
\begin{tabularx}{0.3\textwidth}{XXX}
\arrayrulecolor{red} % choose color
aaaa & bbbb & cccc\\
\midrule
xxxx & yyyy & zzzz\\
\end{tabularx}
\end{document}
Mico
- 506,678
-
-
-
-
@Johannes_B - Currently, the redefinition's scope is the
tabularxenvironment. The scope can be narrowed down further, naturally. Without an MWE or other piece of information from the OP, it's not possible to be too specific about the correct course of action. – Mico Jun 22 '15 at 20:04 -
1
\arrayrulecolor{blue}fromcolortblwork? If not edit the question to have a complete small document that shows the problem. – David Carlisle Jun 22 '15 at 18:18\midruleis not defined bytabularxand is not a standard LaTeX command either. There are many, many, many packages so people do not necessarily know which packages your question requires - never mind issues to do with your choice of document class. In this particular case, many users will recognise\midruleas coming frombooktabsbut that is just because it is a popular package and a frequently-used command. A user new to LaTeX would not be much helped by your question, either. ;) – cfr Jun 22 '15 at 18:42