I'm creating many tables and want to change the colour of text if it is in a certain area to red, see the image below for my example:
For this, I want any cell which is an intersection of lettered columns or rows (the ones with red characters or blank cells) to have red text in them.
This is what my code for it looks like:
\begin{center}
\begin{tabular}{ |c|c|c|c|c|c| }
\hline
&W&X&Y&Z&Stock\\
\hline
A&\textcolor{red}{11}&\textcolor{red}{3}&&&14\\
\hline
B&&\textcolor{red}{12}&\textcolor{red}{4}&&16\\
\hline
C&&&&&20\\
\hline
Demand&11&15&14&10&50\\
\hline
\end{tabular}
\end{center}
This works but is is very time consuming to do \textcolor{red}{number} every time. Is there any shortcut for this?



\def\cred#1{\textcolor{red}{#1}}in your preamble (or latter). Also\newcommand{\cred}[1]{\color{red}#1}will do the same... and then just \cred{12} is enough. In latex you can define your own commands. – koleygr Oct 20 '17 at 10:26