I know that the best way to altern row color is using \rowcolors{2}{}{} but on my .tex file \usepackage[table]{xcolor} doesn't work so I am trying to reach the same result with \if.
I would like to insert in \foreach this:
\if \i is odd then \rowcolor{grey!10} else nothing.
My code is the following.
\begin{table}
\begin{tabular}{cccccc}
\toprule
{} & {\bf Carbon} & {\bf Hydrogen} & {\bf Nitrogen} & {\bf Oxygen\tnote{a}} & {\bf pH}\\
\midrule
\foreach \M[count=\i] in {a,b,c,d}{
{\bf \M} & - & - & - & - & -\\
}
\bottomrule
\end {tabular}
\end {table}
The result should be the following.


\bf(like all similar two letter font commands) has been obsolete for 20 years. Use\bfseriesor\textbfas described in any LaTeX guide. – egreg Oct 12 '15 at 20:53