From this question I learned how to create a table with labels for the rows and columns. But, I'm still struggling to get this to look exactly how I'd like.
I'd like to extend this solution to an arbitrary number of columns, for example I tried to extend it to 3 columns in the latex code below. But, it doesn't seem that I'm able to get the lines to also extend. Could someone help push me the rest of the way?
\begin{tabular}{*6c}
& &\multicolumn{4}{c}{$P$}\\
& & $A$ &$B$ & $C$ \\\cline{3-4}
\multirow{2}{*}& $A$ & \multicolumn{1}{|c|}{$0$} & \multicolumn{1}{c|}{$500$} & \multicolumn{1}{c|}{$500$} \\\cline{3-4}
& $D$ & \multicolumn{1}{|c|}{($100$)} &\multicolumn{1}{c|}{($200$)} & \multicolumn{1}{c|}{($200$)}\\\cline{3-4}
\end{tabular}



