![在 Latex 中创建此形式的表格](https://linux22.com/image/416894/%E5%9C%A8%20Latex%20%E4%B8%AD%E5%88%9B%E5%BB%BA%E6%AD%A4%E5%BD%A2%E5%BC%8F%E7%9A%84%E8%A1%A8%E6%A0%BC.png)
答案1
与。{NiceTabular}
nicematrix
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{w{c}{5mm}cccc}[hvlines,corners=NW] % NW = north-west
& \;\diagbox{A}{B} & \Block{}{C \\ D} & \Block{}{ E \\ F} & \Block{}{ G \\ longer} \\
\Block{4-1}{H1} & I & text 1 & & text \\
& J & text 2 & & text \\
& K & text & & other text \\
& L & text & & text \\
\Block{4-1}{H2} & M & text & smth & text \\
& N & text & & text \\
& O & text & & text \\
& P & text text & & text \\
\end{NiceTabular}
\end{document}