
LaTeX
환경 이 있는 문서가 있는데 tabularx
테이블의 모든 줄을 회색으로 변경해야 합니다. 이 명령을 시도했지만 \arrayrulecolor{grey}\hline
하단 라인의 색상만 변경되었습니다. 모두 변경하는 방법은 무엇입니까?
답변1
이 \arrayrulecolor
명령은 다음 규칙에 대해서만 색상을 설정하지만 이전에 설정된 규칙에 대해서는 색상을 설정하지 않습니다 \arrayrulecolor
. 이 변경은 다음 규칙에 따라 작동하지만 etc. 환경 외부에서는 작동하지 않는다는 점에서 '전역'입니다 tabular(x)
(예제 참조).
\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}