我有下表:
\documentclass{article}
\begin{document}
\begin{tabular}{ll}
this row should be blue & \\
this row should be red & \\
%% these rows alternate between green and yellow
a & b \\
c & d \\
e & f \\
f & g
\end{tabular}
\end{document}
并且我希望单元格有不同的背景颜色,如表格中所述。有什么想法吗?
答案1
\usepackage{colortbl}
\rowcolor{blue}
...\\
\rowcolor{red}
...