Table with colored rows alternating every n rows
This shows one way of adding a counter that increments every row and then having an arbitrary set of tests to switch colours on some condition. This starts off with no background switches to green on row 4 stays green until row 7 when it switches to blue, goes back to no background at row 13, then cycles round again every 20 rows.
\documentclass{article}
\usepackage{colortbl}
\newcounter{myc}
\makeatletter
\def\myrow{}
\CT@everycr{\noalign{%
\global\let\CT@row@color\relax
\stepcounter{myc}%
\ifnum\value{myc}=4
\gdef\myrow{\rowcolor{green}}
\else\ifnum\value{myc}=7
\gdef\myrow{\rowcolor{blue}}
\else\ifnum\value{myc}=13
\gdef\myrow{}
\else\ifnum\value{myc}=20
\setcounter{myc}{0}
\fi\fi\fi\fi
}\myrow}
\begin{document}
\small
\begin{tabular}{>{[\themyc]}ll}
a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\
a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\
a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\
a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\
a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\a&a\\
\end{tabular}
\end{document}
If you load the xcolor package with the table option you also have access to the rowcolors command.
the syntax is \rowcolors{<starting row index>}{<odd row color>}{<even row color>}
Edit:
if you use the tabu package you can use the \taburowcolors
command.
\documentclass[preview]{standalone}
\usepackage{tabu}
\usepackage[table]{xcolor}
\begin{document}
\everyrow{\tabucline-}
\begin{tabu}{|X|X|}
\taburowcolors {green!40..green!40}
test&test\\
test&test\\
test&test\\
test&test\\
\taburowcolors {blue!40..blue!40}
test&test\\
test&test\\
test&test\\
\taburowcolors{white..white}
test&test\\
test&test\\
\end{tabu}
\end{document}
which gives: