我正在尝试制作具有边框的单元格具有不同背景颜色的简单表格。
我读到过你必须使用它\hhline
来避免边框被覆盖但它不起作用(一些边框丢失了)。
\documentclass[12pt,titlepage]{report}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{hhline}
\begin{document}
\definecolor{good}{rgb}{0.80,1,0.51}
\definecolor{some}{rgb}{1,0.91,0.38}
\definecolor{bad}{rgb}{1,0.5,0.5}
\begin{table}
\centering
\def\arraystretch{1.6}%
\begin{tabular}{| p{2.2cm}|p{3.6cm}|p{3.6cm}|p{3.6cm}|}
\hhline{|-|-|-|-|}
& \textbf{a} & \textbf{b} & \textbf{c} \\
\hhline{|-|-|-|-|}
\textbf{a} & \cellcolor{some} b & \cellcolor{good} c & \cellcolor{bad} d \\
\hhline{|-|-|-|-|}
\textbf{a} & \cellcolor{some} b & \cellcolor{good} c & \cellcolor{bad} d \\
\hhline{|-|-|-|-|}
\textbf{a} & \cellcolor{some} b & \cellcolor{good} c & \cellcolor{bad} d \\
\hline
\end{tabular}
\caption{table.}
\label{tab:tab1}
\end{table}
\end{document}