
在長表環境中(因為我需要將表格跨越多個頁面)。如何更改特定的表格線條顏色和線條寬度?
例如,我正在使用此程式碼,但綠線超出了表格。
\documentclass{article}
\usepackage{color}
\usepackage{longtable}
\definecolor{greenTable}{RGB}{61,205,88}
\definecolor{grayTable}{RGB}{216,217,218}
\begin{document}
\arrayrulecolor{grayTable}
\begin{longtable}{l|l}
\textbf{Parameter} &\textbf{Value} \\
\noalign{{
\color{greenTable}
\hrule height 1.5pt
}}
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\noalign{{ \color{greenTable} \hrule height 1.5pt}}
\end{longtable}
\end{document}
答案1
您的範例缺少colortbl
提供的套件\arrayrulecolor
。以下內容是否符合您的要求?
\documentclass{article}
\usepackage{color}
\usepackage{longtable}
\usepackage{colortbl}
\definecolor{greenTable}{RGB}{61,205,88}
\definecolor{grayTable}{RGB}{216,217,218}
\begin{document}
\begin{longtable}{l|l}
\textbf{Parameter} &\textbf{Value} \\
\arrayrulecolor{greenTable}
\hline
\arrayrulecolor{grayTable}
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\hline
abc&123\\
\arrayrulecolor{greenTable}
\hline
\end{longtable}
\end{document}