我有一张带旋转文本的表格。所有这些标题行都应从第二行开始\hline
(类似于“Abs.”),例如
hline
C
BC
BCD
1 BCD
l BCD
o BCD Frequency
CABCD Abs Rel
hline
\begin{table}[htbp]
\begin{tabular}{rrrrrrr}
\hline
\multirow{6}{*}{\rotatebox[origin=cb]{90}{Col1}} & \multirow{6}{*}{\rotatebox[origin=cb]{90}{A}} & \multirow{6}{*}{\rotatebox[origin=cb]{90}{BBBBB}} & \multirow{6}{*}{\rotatebox[origin=cb]{90}{CCCCCC}} & \multirow{6}{*}{\rotatebox[origin=lc]{90}{DDDDD}} & & \\
& & & & & &\\
& & & & & &\\
& & & & & &\\
& & & & & \multicolumn{2}{c}{Frequency} \\
& & & & & Abs. & Rel.\\
\hline
1&9&8&7&6&5&4\\
\end{tabular}
\end{table}
我尝试了不同的来源l
,例如,,,,,r
...但它看起来不像我喜欢的方式。我错在哪里?谢谢!cB
cb
ct
答案1
不需要使用所有这些\multirow
;这是一个可能的解决方案:
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{table}[htbp]
\begin{tabular}{*{7}{r}}
\hline
& & & & & \multicolumn{2}{c}{\multirow{7}{*}{Frequency}}
\\
\rotatebox{90}{Col1} & \rotatebox{90}{A} & \rotatebox{90}{BBBBB}
& \rotatebox{90}{CCCCCC} & \rotatebox{90}{DDDDD} & Abs. & Rel. \\
\hline
1&9&8&7&6&5&4 \\
\end{tabular}
\end{table}
\end{document}
附注:为了让你的桌子看起来更专业,你可能会对booktabs
包(这意味着您的表格将不会使用垂直规则):
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{table}[htbp]
\begin{tabular}{*{7}{r}}
\toprule
& & & & & \multicolumn{2}{c}{\multirow{7}{*}{Frequency}}
\\
\rotatebox{90}{Col1} & \rotatebox{90}{A} & \rotatebox{90}{BBBBB}
& \rotatebox{90}{CCCCCC} & \rotatebox{90}{DDDDD} & Abs. & Rel. \\
\midrule
1&9&8&7&6&5&4 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}