\documentclass[10pt,a4paper]{article}
\usepackage{ctable}
\usepackage{multicol}
\usepackage{multirow}
\begin{document}
\begin{table*}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{r|r|cccccc|ccc|}
\cmidrule{3-11} \multicolumn{1}{r}{} & & \multicolumn{6}{c|}{SOME OTHER HEADER} & \multicolumn{3}{c|}{HEADER} \\
\cmidrule{3-11} \multicolumn{1}{r}{} & & A & B & C & D & E & F & G & H & I \\
\cmidrule{2-11} \multirow{6}[2]{*}{\begin{sideways}OTHER HEADER\end{sideways}} & A & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& B & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& C & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& D & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& E & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& F & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
\cmidrule{2-11} \end{tabular}%
\end{table*}%
\end{document}
答案1
一个选项禁忌,tabularx 扩展。
梅威瑟:
% arara: pdflatex: {synctex: yes, action: nonstopmode}
\documentclass[10pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[scaled]{helvet}
\usepackage{tabu}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{table}[!ht]
\centering
\sffamily
\scriptsize
\caption{The caption}
\def\Thickness{2pt} % Set the thickness for the verticl and horizontal rules.
\arrayrulewidth=\Thickness % Thickness for \cline
\tabulinesep = _3pt^5pt % Celll text separation _{texbox-bottomRule}^{textbox-topRule}
\tabulinestyle{\Thickness black} % Thickness and color for \tabucline
\begin{tabu} to \linewidth {X[0.1]|X[0.5r]|*6{X[c]}|*3{X[c]}|}
\cline{3-11}
%Row2
\multicolumn{2}{c|}{}
& \multicolumn{6}{c|}{\bfseries SOME OTHER HEADER}
& \multicolumn{3}{c|}{\bfseries HEADER} \\ \cline{3-11}
%Row3
\multicolumn{2}{c|}{}& A & B & C & D & E & F & G & H & I \\ \cline{2-11}
& A & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& B & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& C & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& D & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& E & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
\multirow{-6}{*}{\rotatebox{90}{\bfseries OTHER HEADER}}& F & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\[-\Thickness] \tabucline{2-11}
\end{tabu}
\end{table}
\end{document}
答案2
欢迎来到 TeX.SE!如果您只想消除间隙,只需将您的替换\cmidrules
为\clines
。
\documentclass[10pt,a4paper]{article}
\usepackage{ctable}
\usepackage{multicol}
\usepackage{multirow}
\begin{document}
\begin{table*}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{r|r|cccccc|ccc|}
\cline{3-11} \multicolumn{1}{r}{} & & \multicolumn{6}{c|}{SOME OTHER HEADER} & \multicolumn{3}{c|}{HEADER} \\
\cline{3-11} \multicolumn{1}{r}{} & & A & B & C & D & E & F & G & H & I \\
\cline{2-11} \multirow{6}[2]{*}{\begin{sideways}OTHER HEADER\end{sideways}} & A & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& B & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& C & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& D & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& E & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& F & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
\cline{2-11} \end{tabular}%
\end{table*}%
\end{document}
如果您想要不同的线宽,请告诉我。
答案3
\arraystretch
这只是一个简单的表格解决方案,通过更新和使用m
列类型而不是来增加水平和垂直空间c
。
另外,像 marmot 那样将\cmidrule
s 替换为s\cline
\documentclass[10pt,a4paper]{article}
\usepackage{ctable}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{lipsum}
\newcolumntype{C}{>{\centering\arraybackslash}m{0.7cm}}
\newcolumntype{D}{>{\centering\arraybackslash}m{0.9cm}}
\begin{document}
\lipsum[1]
\begin{table*}[htbp]
\centering
\caption{Add caption}
\renewcommand\arraystretch{1.3}
\begin{tabular}{r|r|CCCCCC|DDD|}
\cline{3-11} \multicolumn{1}{r}{} & & \multicolumn{6}{c|}{SOME OTHER HEADER} & \multicolumn{3}{c|}{HEADER} \\
\cline{3-11} \multicolumn{1}{c}{} & & A & B & C & D & E & F & G & H & I \\
\cline{2-11} \multirow{6}[2]{*}{\begin{sideways}OTHER HEADER\end{sideways}} & A & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& B & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& C & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& D & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& E & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
& F & 0 & 0 & 0 & 0 & 0 & 0 & 0.00 & 0.00 & 0.00 \\
\cline{2-11} \end{tabular}%
\end{table*}%
\end{document}