4

This question already has an answer here:

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 Jun 22 '15 at 18:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    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
  • 2
    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
9

Something like this?

enter image description here

\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
  • 1
    Yes, you are right about that :-) – Johannes_B Jun 22 '15 at 20:05

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