答案1
无需任何额外的包和太多麻烦,只需使用\multicolumn
和\cline
语句(以及通常的表格命令等)
\documentclass{article}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{|l|*{8}{p{1.2cm}|}}
\hline
Derivative & \multicolumn{8}{c|}{Integral layer} \tabularnewline
\cline{2-9}
layer & Type1 & Type2 & Type3 & Type4 & Type5 & Type6 & Type7 & Type8 \tabularnewline
\hline
A & & & & & & & & \tabularnewline
\hline
B & & & & & & & & \tabularnewline
\hline
\end{tabular}
\end{document}
答案2
Christian 的答案给出了确切的格式,但这里有一个使用书签我认为看起来更好:
\documentclass{article}
\usepackage[margin=1in]{geometry} % table is too wide for default margins
\usepackage{booktabs}
\usepackage{lipsum} % to show extent of margins
\begin{document}
\lipsum[1]
\begin{table}
\centering
\begin{tabular}{r *{8}{c}} \toprule
& \multicolumn{8}{c}{Integral layer} \\ \cmidrule{2-9}
Derivative layer & Type 1 & Type 2 & Type 3 & Type 4 & Type 5 & Type 6 & Type 7 & Type 8 \\ \midrule
A & & & & & & & \\
B & & & & & & & \\
C & & & & & & & \\
D & & & & & & & \\
E & & & & & & & \\
F & & & & & & & \\
G & & & & & & & \\ \bottomrule
\end{tabular}
\caption{\label{tab:thetable} The table}
\end{table}
\end{document}