当我们\cmidrule
在表格中插入宽度或颜色时,第二个\cmidrule
会变窄,请问如何修复,请查找 MWE 文件:
\documentclass{book}
\usepackage{ragged2e}
\usepackage{dcolumn,booktabs,colortbl}
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash\hspace{0pt}}p{#1}}%\hangindent6pt
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\Centering\arraybackslash\hspace{0pt}}p{#1}}
\begin{document}
\begin{tabular}{lllll}
\toprule
A & B &C &D &E\\
\arrayrulecolor{blue}\cmidrule[2pt]{2-3}\arrayrulecolor{red}\cmidrule[2pt]{4-5}%
A & B &C &D &E\\
A & B &C &D &E\\
A & B &C &D &E\\
\bottomrule
\end{tabular}
\bigskip
\begin{tabular}{lllll}
\toprule
A & B &C &D &E\\
\arrayrulecolor{blue}\cmidrule{2-3}\arrayrulecolor{red}\cmidrule{4-5}%
A & B &C &D &E\\
A & B &C &D &E\\
A & B &C &D &E\\
\bottomrule
\end{tabular}
\bigskip
\begin{tabular}{lllll}
\toprule
A & B &C &D &E\\
\cmidrule{2-3}\cmidrule{4-5}%
A & B &C &D &E\\
A & B &C &D &E\\
A & B &C &D &E\\
\bottomrule
\end{tabular}
\end{document}