![Como mudar a cor de todas as linhas do tabularx?](https://rvso.com/image/330752/Como%20mudar%20a%20cor%20de%20todas%20as%20linhas%20do%20tabularx%3F.png)
Tenho um LaTeX
documento, onde possuo um tabularx
ambiente, e preciso alterar todas as linhas da tabela para cinza. Eu tentei este comando \arrayrulecolor{grey}\hline
, mas mudou apenas a cor da linha inferior, como mudar todos eles?
Responder1
Os \arrayrulecolor
comandos definem a cor apenas para as regras a seguir, mas não para aquelas que foram definidas antes de \arrayrulecolor
serem usadas. Esta mudança é 'global' no sentido de que atua de acordo com as seguintes regras, mas não fora do tabular(x)
ambiente etc. (veja o exemplo)
\documentclass{book}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\linewidth}{lX}
\hline
foo & foobar \tabularnewline
\arrayrulecolor{red}
\hline
\end{tabularx}
\begin{center}
Another table with black rules
\end{center}
\begin{tabularx}{\linewidth}{lX}
\hline
foo & foobar \tabularnewline
\hline
\end{tabularx}
\begin{center}
Another table with red rules
\end{center}
\begin{tabularx}{\linewidth}{lX}
\arrayrulecolor{red}
\hline
foo & foobar \tabularnewline
\hline
\end{tabularx}
\end{document}