I am using Qrrbrbirlbel's solution to build the confusion matrix as given in the figure. The problem is when extend the rows and column to 10 as given in the code it gives me the error as stated in the title. I have to draw 14*14 matrix. Kindly help
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{array,hhline}
\makeatletter
\newcommand*{\ccol}[1]{%
\ifdim#1pt<.5pt\relax\else\color{white}\fi
\edef\x{\noexpand\cellcolor[gray]{\strip@pt\dimexpr1pt-#1pt}}\x
#1%
}
\newlength{\cellwidth}
\settowidth{\cellwidth}{0.00}
\def\jline{\\\hhline{~*{10}{|-}|}}
\makeatother
\begin{document}
\begin{tabular}{l*{10}{|>{\centering\arraybackslash}m{\cellwidth}}|}
\noalign{\gdef\w#1{\multicolumn{1}{c}{#1}}}
\w{} & \w{hw} & \w{bx} & \w{wk} & \w{jg} & \w{cl} & \w{rn}\& \w{cl} & \w{rn}\& \w{cl} & \w{rn}\jline
ving & \ccol{1} & 0 & 0 & 0 & 0 & 0& 0 & 0& 0 & 0\jline
xing & 0 & \ccol{0.92} & \ccol{0.08} & 0 & 0 & 0 & 0 & 0& 0 & 0\jline
king & 0 & \ccol{0.03} & \ccol{0.97} & 0 & 0 & 0& 0 & 0& 0 & 0\jline
ging & 0 & 0 & 0 & \ccol{1} & 0 & 0& 0 & 0& 0 & 0\jline
ping & 0 & 0 & 0 & 0 & \ccol{1} & 0& 0 & 0& 0 & 0\jline
ning & 0 & 0 & 0 & 0 & 0 & \ccol{1}& 0 & 0& 0 & 0\jline
ning & 0 & 0 & 0 & 0 & 0 & \ccol{1}& 0 & 0& 0 & 0\jline
ning & 0 & 0 & 0 & 0 & 0 & \ccol{1}& 0 & 0& 0 & 0\jline
ning & 0 & 0 & 0 & 0 & 0 & \ccol{1}& 0 & 0& 0 & 0\jline
ning & 0 & 0 & 0 & 0 & 0 & \ccol{1}& 0 & 0& 0 & 0\jline
\noalign{\global\let\w\undefined}
\end{tabular}
\end{document}


*{10}not*10. – daleif Feb 23 '19 at 07:27\wat that location. – daleif Feb 23 '19 at 07:38\&(twice) instead of&. – egreg Feb 23 '19 at 09:42\winside\noalignand to make it globally undefined at the end? This will overwrite any standing definition of\w. Thus it's much better to do\newcommand{\w}{...}in the preamble. – egreg Feb 23 '19 at 10:11