我正在用 Latex 写一篇文章,并为多行表的背景颜色苦苦挣扎。
这是图像。正如你所看到的,右边的最后一列只有一半颜色。我需要它全彩色。
这是我的代码的相应摘录:
\rowcolor{RedFill}
5.88\% &10.6\% & 6.74\% & \multirow{ 2}{*}{ALTA}\\
\rowcolor{RedFill}
9.01\% &14.6\% & 6.09\% \\
Run Code Online (Sandbox Code Playgroud)
我还尝试应用 Stackoverflow 中建议的不同解决方案,但它对我不起作用(我意识到,通过根据我的情况调整解决方案,我可能以错误的方式应用它)
\rowcolor{RedFill}
5.88\% &10.6\% & 6.74\% & \multirow{ 2}{*}{ALTA}\\
\rowcolor{RedFill}
9.01\% &14.6\% & 6.09\% & \rowcolor{RedFill}\\
Run Code Online (Sandbox Code Playgroud)
任何提示?
将\multirow语句放在下一行,并为行跨度使用负数:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{multirow}
\colorlet{RedFill}{red!20}
\begin{document}
\begin{tabular}{ *{4}{c} }
\rowcolor{RedFill} 5.88\% & 10.6\% & 6.74\% & \multirow{ 2}{*}{ALTA} \\
\rowcolor{RedFill} 9.01\% & 14.6\% & 6.09\%
\end{tabular}
\begin{tabular}{ *{4}{c} }
\rowcolor{RedFill} 5.88\% & 10.6\% & 6.74\% & \multirow{ 2}{*}{ALTA} \\
\rowcolor{RedFill} 9.01\% & 14.6\% & 6.09\% &
\end{tabular}
\begin{tabular}{ *{4}{c} }
\rowcolor{RedFill} 5.88\% & 10.6\% & 6.74\% & \\
\rowcolor{RedFill} 9.01\% & 14.6\% & 6.09\% & \multirow{-2}{*}{ALTA}
\end{tabular}
\begin{tabular}{ *{4}{c} }
\rowcolor{RedFill} 5.88\% & 10.6\% & 6.74\% & \\
\rowcolor{RedFill} 9.01\% & 14.6\% & 6.09\% & \raisebox{.5\normalbaselineskip}[0pt][0pt]{ALTA}
\end{tabular}
\end{document}
Run Code Online (Sandbox Code Playgroud)
通过使用向上移动内容\raisebox(连同删除生成的框高度/深度 - [0pt][0pt])来提供类似的选项。
| 归档时间: |
|
| 查看次数: |
3181 次 |
| 最近记录: |