# Color midrule in tabularx [duplicate]

I have created a table using tabularx. Can I color the \midrule instead of having it colored black as default?

## marked as duplicate by Werner tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jun 22 '15 at 18:50

• doesn't \arrayrulecolor{blue} from colortbl work? If not edit the question to have a complete small document that shows the problem. – David Carlisle Jun 22 '15 at 18:18
• Apparently you still have not understood how this site works: Provide a MWE – user31729 Jun 22 '15 at 18:18
• It really would make it much easier to help if you would provide a minimum working example. For example \midrule is not defined by tabularx and 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 \midrule as coming from booktabs but 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

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}

• That would color all booktabs rules, right? – Johannes_B Jun 22 '15 at 18:57
• @Johannes_B -- Not just the booktabs rules... – Mico Jun 22 '15 at 18:58
• Oh, right. Doesn't seem like a good idea to redefine that :-( – Johannes_B Jun 22 '15 at 19:06
• @Johannes_B - Currently, the redefinition's scope is the tabularx environment. 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
• Yes, you are right about that :-) – Johannes_B Jun 22 '15 at 20:05