行的颜色背景以提高可读性

行的颜色背景以提高可读性

我想为表格的行添加不同的背景颜色以提高可读性。我的示例(不是 Jet 最低限度工作)如下:

\documentclass{article}
\usepackage{amssymb,pifont,booktabs,caption,fixltx2e}
\usepackage[flushleft]{threeparttable}

\usepackage{multirow}

\begin{document} 
%\begin{landscape}
\begin{table}[htbp]
\begin{threeparttable}
\centering
\caption{Open Market Operations }
\begin{tabular}{p{3cm} p{3cm}cccccccc}
\hline
&                      & \textbf{A} & \textbf{B} & \textbf{Bh} & \textbf{I} & \textbf{Ma} & \textbf{Ne} & \textbf{Pa} & \textbf{S} \\
\hline

\multirow{5}{3cm} {\textbf{Frequency}} 
& Once a day           & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\
& More than once a day & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\
& Weekly               & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{55} \\
& Fortnightly          & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\
& Others               & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\
\hline

\multirow{4}{3cm} {\textbf{Tenor}}     
& Overnight            & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\
& 2-7 days             & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{55} & \ding{51} & \ding{51} \\
& 8-14 days            & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\
& More than 14 days    & \ding{55} & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{51} \\
\hline

\multirow{2}{3cm} {\textbf{Eligible Assets for Collateral} }
& Government securities& \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\
& Central bank bills   & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\
\hline

\multirow{3}{3cm} {\textbf{Nature of Transaction}} 
& Outright             & \ding{51} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} \\
& Repo                 & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\
& Other                & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\
\hline

\multirow{2}{3cm} {\textbf{Interest Rate Determination}}
& Auction              & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\
& Fixed rate           & \ding{55} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\
\hline
\end{tabular}

\begin{tablenotes}
\small
\item Source: 
\item 1 OMOs through.
\item 2 Daily and weekly Liquidity Adjustment Facility.
\item 3 91 days
\item 4 By way of secondary market transactions
\item A: S
\end{tablenotes}

\end{threeparttable}
\label{tab:addlabel}
\end{table}
\end{document}

答案1

我不太确定你的问题。这就是你想要的吗?

彩色表格条目

\documentclass{article}
\usepackage{amssymb,pifont,booktabs,caption,fixltx2e}
\usepackage[flushleft]{threeparttable}
\usepackage{xcolor}

\usepackage{multirow}

\newcommand{\ok}  {\textcolor{green}{\ding{51}}}
\newcommand{\fail}{\textcolor{red}  {\ding{55}}}

\begin{document} 

%\ok{} \fail{}

\begin{table}[htbp]
\begin{threeparttable}
\centering
\caption{Open Market Operations }
\begin{tabular}{p{3cm}p{3.5cm}cccccccc}
\hline
&                      & \textbf{A} & \textbf{B} & \textbf{Bh} & \textbf{I} & \textbf{Ma} & \textbf{Ne} & \textbf{Pa} & \textbf{S} \\
\hline

\multirow{5}{3cm} {\textbf{Frequency}} 
& Once a day           &\fail&\ok  &\fail&\ok  &\fail&\fail&\fail&\fail \\
& More than once a day &\fail&\fail&\fail&\fail&\fail&\fail&\fail&\ok   \\
& Weekly               &\fail&\ok  &\fail&\ok  &\ok  &\ok  &\ok  &\fail \\
& Fortnightly          &\ok  &\fail&\fail&\fail&\fail&\fail&\fail&\fail \\
& Others               &\fail&\fail&\ok  &\fail&\fail&\fail&\fail&\fail \\
\hline

\multirow{4}{3cm} {\textbf{Tenor}}     
& Overnight            &\ok  &\ok  &\fail&\fail&\fail&\fail&\fail&\ok   \\
& 2-7 days             &\fail&\ok  &\fail&\ok  &\ok  &\fail&\ok  &\ok   \\
& 8-14 days            &\fail&\fail&\fail&\fail&\fail&\fail&\fail&\ok   \\
& More than 14 days    &\fail&\ok  &\ok  &\fail&\fail&\ok  &\fail&\ok   \\
\hline

\multirow{2}{3cm} {\textbf{Eligible Assets for Collateral} }
& Government securities&\fail&\ok  &\ok  &\ok  &\ok  &\ok  &\ok  &\ok  \\
& Central bank bills   &\ok  &\ok  &\fail&\fail&\fail&\fail&\fail&\ok  \\
\hline

\multirow{3}{3cm} {\textbf{Nature of Transaction}} 
& Outright             &\ok  &\fail&\fail&\ok  &\fail&\ok  &\ok  &\ok  \\
& Repo                 &\fail&\ok  &\fail&\ok  &\ok  &\ok  &\ok  &\ok  \\
& Other                &\fail&\ok  &\fail&\fail&\fail&\fail&\fail&\fail\\
\hline

\multirow{2}{3cm} {\textbf{Interest Rate Determination}}
& Auction              &\ok  &\ok  &\ok  &\ok  &\ok  &\ok  &\ok  &\ok  \\
& Fixed rate           &\fail&\fail&\fail&\ok  &\fail&\fail&\fail&\fail\\
\hline
\end{tabular}

\begin{tablenotes}
\small
\item Source: 
\item 1 OMOs through.
\item 2 Daily and weekly Liquidity Adjustment Facility.
\item 3 91 days
\item 4 By way of secondary market transactions
\item A: S
\end{tablenotes}

\end{threeparttable}
\label{tab:addlabel}
\end{table}
\end{document}

相关内容