tabularx 列文本对齐颜色

tabularx 列文本对齐颜色

我创建了一个具有列规范的 tabularx 表。

`\setlength\extrarowheight{5pt} %Augmente la taille des lignes du tableau
`%          \begin{tabularx}{1\linewidth}{| >{\columncolor{DarkBlue}\color{white}}C | C | C | C | p{0.06\linewidth} |}
        \begin{tabularx}{1\linewidth}{| C | C | C | C | p{0.06\linewidth} |}
            \hline
            \rowcolor{DarkBlue}
            \textcolor{white}{RISK CATEGORY} & 
            \textcolor{white}{RISK MEASURES / CONTROLS} &
            \textcolor{white}{FREQUENCY} & 
            \textcolor{white}{NOTES} & 
            \textcolor{white}{RISK ASS.} \\ \hline
            %\multirow{10}{*}{\begin{sideways}{\textbf {MARKET RISK}}\end{sideways}} & Monitoring of investment limits & Daily & No active breaches identified. & 25 \\ \cline{2-5}
             & Monitoring of investment limits & Daily & No active breaches identified. & \cellcolor{LightGreen} \\ \hhline{~|*4-}
             & Monitoring of Global Exposure - VaR & Daily & No breach identified and no items to be raised to the Board. & \cellcolor{LightGreen} \\ \hhline{~|*4-}
             & Monitoring of Stress testing & Monthly & No items to raise to the Board. & \cellcolor{red} \includegraphics{C:/Users/jonathanrombeau/Desktop/Report/Arrow.png} \\  \hhline{~|*4-}
            \multirow{-4}{*}{MARKET RISK} & Monitoring of Back testing & Monthly & The sub-funds Brevan Howard Dynamic Global Investment Fund had two outliers and Brevan Howard Dynamic US Investment Fund had one outlier using a VAR at 99\% confidence interval. & \cellcolor{LightGreen} \\ \hline
        \end{tabularx}

格式非常好,但是如果取消注释第一个定义以使用颜色,则名为 RISK CATEGORY 的标题将不再对齐在其单元格的顶部。

例如: 无色彩

带有颜色

答案1

使用

\leavevmode\color

因此段落在颜色之前开始,或者如果您不想在第一列中换行,那么更好的方法是使用cnotC作为第一列。

相关内容