3

i have a table with rotated text. All these header lines should start near the second \hline (similar to "Abs.") like

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}

I tried different origin like l, r, cB, cb, ct, ... but it doesn't look like the way i would prefer. what do i wrong? thank you!

2

No need to use all those \multirows; here's a possible solution:

\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}

enter image description here

As a side note, to make your tables look professional, you might be interested in the booktabs package (this implies that your tables won't use vertical rules):

\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}

enter image description here

  • tnx a lot mr. gonzalo medina for your helping hand :)! – MyUser Jun 2 '13 at 9:02
  • @MyUser you're welcome! Don't forget that you can up-vote good answers and accept the one you consider best solved your problem by clicking the checkmark to its left. In case of doubt, please see How do you accept an answer?. – Gonzalo Medina Jun 2 '13 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.