[Tex/LaTex] How to alternate colors in table

colortables

I build a table almost like the table in my picture. But how can I change the color between the stages like in the picture:

This is what i want

\documentclass[a4paper, 12pt,fleqn]{article} 
\usepackage[left=30mm,right=40mm,top=25mm,bottom=20mm, includeheadfoot]  
 {geometry}%centering hinter headfoot
 \usepackage[ngerman]{babel}
 \usepackage[rm={tabular, lining},sf={tabular, lining},tt={monowidth, tabular,       
  lining}]{cfr-lm}
  \usepackage[onehalfspacing]{setspace}     
 \pagestyle{myheadings}
\usepackage{courier}
\renewcommand*\familydefault{\sfdefault} %Schriftart geändert
 \usepackage{booktabs}
\usepackage{hhline}


\begin{document}
  \begin{table}[htbp]
\centering
  \begin{tabular}{cccccccccccc}
   \multicolumn{8}{l}{Datensatz-1 für das Beispielproblem}\\
     \toprule
  & & & & &  \multicolumn{6}{c}{Job}\\
  Stufe & Machsine & & & &  \multicolumn{2}{c}{$n=1$} & & & 
  \multicolumn{3}{c}{$n=2$}\\
  \cmidrule{5-12}
 $i$ & $m$ & 
  $F_{m,i}$ & $R_{m,i}$ & $B_{n,i}$ & $A_{n,i}$ & $D_{n,m,i}$ & 
 $T_{n,m,i}$ & $B_{n,i}$ & $A_{n,i}$ & $D_{n,m,i}$ & $T_{n,m,i}$ \\
 \midrule
   1& & & &1&1& & &1&1& & \\
    &1&0&6& &1&4& & & &1&6 \\
    &2&0&6& &1&4& & & &1&6 \\
   &3&0&6& &1&4& & & &1&6 \\
   2& & & &1&1& & &1&1& & \\
  &1&0&6& & &1&5& & &1&4 \\
  &2&0&6& & &1&5& & &1&4 \\
   3& & & &1&1& & &1&1& & \\
   &1&0&6& & &1&6& & &1&5 \\
  &2&0&6& & &1&6& & &1&5 \\

   \bottomrule
 & & $J_{n}$ & & & \multicolumn{3}{c}{3} & &   \multicolumn{3}{c}{3}\\
 & & $Q_{n}$ & & & \multicolumn{3}{c}{80} & &   \multicolumn{3}{c}{60}\\

\bottomrule  

 \end{tabular}
\label{default}
\end{table} 
\end{document}

Best Answer

Place \rowcolor{<colour>} in every row that you want the row colour to change. In your case, you'll need a \rowcolor three times to cover the areas.

Since you're using booktabs, see Professional-looking tables with alternating row colors? on how to adjust \midrule and \bottomrule to incorporate some \rowcolor immediately following/preceding it.

Related: How to create alternating rows in a table?

Related Question