如何使用给定的脚本绘制如下所示的表格。
\documentclass[12pt]{article}
\usepackage{multirow}
\usepackage{colortbl}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{|*{10}{c|}}
\hline
\multicolumn{2}{|>{}c|}{} & \multicolumn{3}{c|}{TOP.1} & \multicolumn{3}{c|}{TOP.2} \\
\arrayrulecolor{black}
\cline{3-8}
\multicolumn{2}{|>{}c|}{} & TOP.1.1 & TOP.1.2 & TOP.1.3 & TOP.2.1 & TOP.2.2 & TOP.2.3\\
\hline
\multirow{3}{*}{SIDE.1}
& SIDE.1.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
& SIDE.1.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
& SIDE.1.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
\hline
\multirow{3}{*}{SIDE.2}
& SIDE.2.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
& SIDE.2.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
& SIDE.2.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
\hline
\end{tabular}
\end{figure}
\end{document}
答案1
\documentclass[12pt]{article}
\usepackage{multirow}
\usepackage{rotating}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{ccccccccc}
\cline{4-9}
\multicolumn{3}{c}{} & \multicolumn{6}{|c|}{TOPS} \\ \hline
\multicolumn{1}{|c}{\multirow{8}{*}{\begin{sideways}SIDES\end{sideways}}} & \multicolumn{2}{|c}{} & \multicolumn{3}{|c}{TOP.1} & \multicolumn{3}{|c|}{TOP.2} \\ \cline{4-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{2}{|c}{} & \multicolumn{1}{|c}{TOP1.1} & \multicolumn{1}{|c}{TOP1.2} & \multicolumn{1}{|c}{TOP1.3} & \multicolumn{1}{|c}{TOP2.1} & \multicolumn{1}{|c}{TOP2.2} & \multicolumn{1}{|c|}{TOP2.3} \\ \cline{2-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.1}} & \multicolumn{1}{|c}{SIDE1.1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE1.2} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE1.3} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{2-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.2}} & \multicolumn{1}{|c}{SIDE2.1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE2.2} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
\multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE2.3} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \hline
\end{tabular}
\end{figure}
\end{document}
导致:
答案2
这是一个可能的解决方案。
代码
\documentclass[border=10pt]{standalone}
%\usepackage[landscape]{geometry}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{colortbl}
\begin{document}
%\begin{figure}
\centering
\begin{tabular}{ccc|*{6}{c|}} \cline{4-9}
& & &\multicolumn{6}{c|}{Tops}\\ \hline
\multicolumn{1}{|c}{\multirow{8}{*}{\rotatebox[origin=cc]{270}{Slides} } } & \multicolumn{2}{|c|}{} & \multicolumn{3}{c|}{TOP.1} & \multicolumn{3}{c|}{TOP.2} \\
\arrayrulecolor{black} \cline{4-9}
\multicolumn{1}{|c}{} & \multicolumn{2}{|c|}{} & TOP.1.1 & TOP.1.2 & TOP.1.3 & TOP.2.1 & TOP.2.2 & TOP.2.3\\
\cline{2-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.1}} & \multicolumn{1}{|c|}{SIDE.1.1} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{}& \multicolumn{1}{|c|}{SIDE.1.2} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} & \multicolumn{1}{|c|}{SIDE.1.3} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9} \cline{2-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.2}} & \multicolumn{1}{|c|}{SIDE.2.1} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} & \multicolumn{1}{|c|}{SIDE.2.2} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} & \multicolumn{1}{|c|}{SIDE.2.3} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9} \hline
\end{tabular}
%\end{figure}
\end{document}