To write the solution of an exercise, i want to fill in the tabular with the answers in red. The headlines of the table should stay in the same style than the exercise and only a part of the table should be colorized. I can achieve that by using \textcolor{red}{...}
in each cell of my table but it's pretty brutal. I'm looking for a solution to declare that all the following words must be in red untill the end of the environment tabular.
I've tried some \color{red}
but it doesn't work.
Here is a small example.
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[left=1.00cm, right=1.00cm, top=1.00cm, bottom=1.00cm]{geometry}
\usepackage{colortbl}
\usepackage{chemformula}
\begin{document}
\begin{center}
\footnotesize
\renewcommand{\arraystretch}{1.5}
\hspace*{-1cm}\begin{tabular}{|c|c|c||c|c|c|c|c|c|c|c|}
\hline \rowcolor{black}
\multicolumn{11}{|c|}{\textcolor{white}{Corps purs}}\\\hline
\rowcolor{gray!90}
élémentaires&
\multicolumn{2}{c||}{simples} & \multicolumn{8}{c|}{composés}\\
\hline
\rowcolor{gray!70}
&métal.& non-métal. & \multicolumn{2}{c|}{Oxydes} & Hydroxydes & \multicolumn{2}{c|}{Acides} & \multicolumn{2}{c|}{Sels} & Corps organiques\\
\hline
\rowcolor{gray!50}
&& & métal. & non-métal. & & bin. & tern. & bin. & tern. &\\
\hline
&& & & & & & & & &\ch{C6H12O6}\\
\hline
&& \ch{Fe2O3} & & & & & & & &\\
\hline
&& & & & & & & & &\\
\hline
&& & & & & & & & &\\
\hline
&& & & & & & & & &\\
\hline
&& & & & & & & & &\\
\hline
\end{tabular}
\end{center}
\end{document}
Desired output :
PS : i'm aware that Fe2O3 is at the wrong place, it was only for a second element :) !
\color{red}
before the table and locally change the textcolor of the header cells back to their original color?\textcolor{<color>}{<text>}
in each cell. For header cells or for later stuff. Here it asks to me to change the color for each 17 cells. I'm sure it's possible to change color from a starting point to an ending accross a table but i can't find a practical way.