\multicolumn是合并列 \multirow是合并行
\begin{table}[!h] \small
\centering
\caption{This is a caption} \label{mult}
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{1}{|c|}{a} & b & c & d \\
\hline
\multirow{6}{*}{A}
& q & w & e \\
\cline{2-4}
& \multirow{2}{*}{r} & t & y \\
\cline{3-4}
& & u & i
\\
\cline{2-4}
& \multirow{2}{*}{z} & x & c \\
\cline{3-4}
& & v & b\\
\cline{2-4}
& n & m & l \\
\hline
\end{tabular}
\end{table}