![具有多行和多列且文本垂直排列的复杂表格](https://linux22.com/image/386897/%E5%85%B7%E6%9C%89%E5%A4%9A%E8%A1%8C%E5%92%8C%E5%A4%9A%E5%88%97%E4%B8%94%E6%96%87%E6%9C%AC%E5%9E%82%E7%9B%B4%E6%8E%92%E5%88%97%E7%9A%84%E5%A4%8D%E6%9D%82%E8%A1%A8%E6%A0%BC.png)
答案1
结合\multirow
和\multicolumn
:
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} & \multicolumn{2}{|c|}{Managment B}\\
\cline{3-4}
\multicolumn{2}{|c|}{\multirow{-2}{*}{}} & yes & no\\
\hline
\multirow{2}{*}{\rotatebox{90}{Managment A }} & yes & 1 & 2\\[0.8cm]
\cline{2-4}
& yes & 3 & 4\\[0.8cm]
\hline
\end{tabular}
\end{document}
答案2
您的问题不清楚...提供的图像是否都是您想要在表格中呈现的内容,或者单元格中的文本是否更长,而不是所显示的单个“文本”。
假设这些单元格中的“文本”将是更长的文本,那么以下解决方案可能会对您有所帮助:
\documentclass{article}
\usepackage{rotating}
\usepackage{makecell, multirow, tabularx}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\newcommand\mcbf[1]{\multicolumn{1}{>{\bfseries}c|}{#1}}
\usepackage{lipsum} % for dummy text
\begin{document}
\begin{table}
\centering
\sffamily
\settowidth\rotheadsize{ Management A }
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{|c|c|X|X|}
\hline
\multicolumn{2}{|c|}{}
& \multicolumn{2}{c|}{ \thead{Management B}} \\
\cline{3-4}
\multicolumn{2}{|c|}{}
& \thead{YES} & \thead{NO} \\
\hline
\multirow{10}{*}{\rothead{Management A}}
& YES & \mcbf{Group 1} & \mcbf{Group 2} \\
& & Sed feugiat. Cum sociis natoque penatibus
et magnis dis parturient montes, nascetur
ridiculus mus. & text \\
\cline{2-4}
& NO & \mcbf{Group 3} & \mcbf{Group 4} \\
& & Sed feugiat. Cum sociis natoque penatibus
et magnis dis parturient montes, nascetur
ridiculus mus. & text \\
\hline
\end{tabularx}
\end{table}
\end{document}