0

I have the following table:

\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}

and I would like to have different background colors for the cells, as mentioned in the table. Any ideas?

1 Answers1

-1
\usepackage{colortbl}
\rowcolor{blue}

...\\

\rowcolor{red}

...

MadyYuvi
  • 13,693
  • 3
    That's a very bad solution, because the alternating aspect is done better by automation (I linked an answer under the question). Please make your answer a real answer by also explaining what you did. – TeXnician May 26 '17 at 12:39
  • 1
    https://tex.meta.stackexchange.com/questions/1192/how-do-i-mark-code-blocks may be of interests. – samcarter_is_at_topanswers.xyz May 26 '17 at 12:44