
Tengo un LaTeX
documento donde tengo un tabularx
entorno y necesito cambiar todas las líneas de la tabla a gris. Probé este comando \arrayrulecolor{grey}\hline
, pero cambió solo el color de la línea inferior, ¿cómo cambiarlos todos?
Respuesta1
Los \arrayrulecolor
comandos establecen el color solo para las siguientes reglas, pero no para aquellas que se establecieron antes de \arrayrulecolor
usarse. Este cambio es "global" en el sentido de que actúa según las siguientes reglas, pero no fuera del tabular(x)
entorno, etc. (ver el ejemplo)
\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}