在表格中使用颜色时跨度规则消失

在表格中使用颜色时跨度规则消失

大家好!这里我的需求是表格列具有不同的颜色和相应的跨度规则。当我们使用 \cline{} 时,它消失了,并被下一行颜色覆盖。请告诉我如何解决这个问题。

红色标记的是规则遗漏的区域。跨度规则表

梅威瑟:

\documentclass{book} 
%\usepackage{pdfx}
\usepackage{colortbl,multirow} 
\begin{document}
\chapter{Sample title} 
\section{Head one First}
Between 200BC and 100BC, during $\mathcal{A}$ the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while
discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.

\begin{tabular}{|l|l|l|}
\hline
\textbf{Discussing quadratic} & \textbf{Modern sense} &\\
\hline
\cellcolor{green}Han Dynasty  & \cellcolor{green}Chinese markup & \cellcolor{yellow} \\
\cline{1-2}
\cellcolor{green}Han Dynasty  & \cellcolor{green}Chinese markup &\cellcolor{yellow}Poor ratio\\
\cline{1-2}
\cellcolor{green}Han Dynasty  & \cellcolor{green}Chinese markup &\cellcolor{yellow}\\
\hline
\end{tabular}


\section{Head one Second}
Between 200BC and 100BC, during the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.

\end{document} 

答案1

和彩色单元格的问题\cline已为人所知。解决方法是使用与\hhline颜色配合良好的:将 hhline 的最后一部分的颜色设置为黄色,然后将其恢复为黑色。

\documentclass{book}
\usepackage{colortbl,multirow, hhline}

\begin{document}

\chapter{Sample title}

\section{Head one First}
Between 200BC and 100BC, during $\mathcal{A}$ the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while
discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.
\begin{center}
\aboverulesep = 0pt
\belowrulesep = 0pt
\begin{tabular}{|l|l|l|}
\hline
\textbf{Discussing quadratic} & \textbf{Modern sense} &\\
\hline
\cellcolor{green}Han Dynasty & \cellcolor{green}Chinese markup & \cellcolor{yellow} \\
\hhline{-->{\arrayrulecolor{yellow}}->{\arrayrulecolor{black}}|}
\cellcolor{green}Han Dynasty & \cellcolor{green}Chinese markup &\cellcolor{yellow}Poor ratio\\
\hhline{-->{\arrayrulecolor{yellow}}->{\arrayrulecolor{black}}|}
\cellcolor{green}Han Dynasty & \cellcolor{green}Chinese markup &\cellcolor{yellow}\\
\hline
\end{tabular}
\end{center}

\section{Head one Second}
Between 200BC and 100BC, during the Han Dynasty, the Chinese used matrix-type methods with the text \textit{Nine chapters on the mathematical art}. There was further development, but it was not until 1683 when the idea of a determinant appeared in Japan when Seki wrote \textit{Method of solving the dissimulated problems}. This used matrix methods in tables in the same way as the earlier work of the Chinese. Ten years later the determinant first appeared in Europe in the work of Leibniz. The word determinant was first introduced by Gauss in 1801 while discussing quadratic forms, but Cauchy in 1812 used determinant in the modern sense.

\end{document} 

在此处输入图片描述

相关内容