2

I've got the following table:

\documentclass[11pt]{article}

\usepackage{rotating}

\usepackage[
    lmargin=1.0in,
    rmargin=1.0in,
    tmargin=2.0cm,
    bmargin=2.0cm
]{geometry}

\usepackage{tabularx, booktabs}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

\usepackage{multirow}

\begin{document}

\begin{table}
    \centering
    % table caption is to be above the table
    \caption{Table title.}
    \scalebox{0.65}{
    \begin{tabularx}{1.5\textwidth}{ll *{10}{Y}}
    \toprule
      & & \multicolumn{10}{c}{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}\\[2mm]
      & & 0.1 & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 & 0.7 & 0.8 & 0.9 & 1.0\\
    \cmidrule[0.6pt]{3-12}
        \parbox[t]{3mm}{\multirow{20}{*}{\rotatebox[origin=c]{90}{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}}}
            &\multirow{2}{*}{0.1}
            &40.14 & 29.7 & 23.58 & 19.57 & 16.75 & 14.67 & 13.05 & 11.77 & 10.73 & 9.86\\
            &
            &$(0\%)$ & $(5.18\%)$ & $(14.29\%)$ & $(24.2\%)$ & $(34.18\%)$ & $(44.0\%)$ & $(53.58\%)$ & $(62.89\%)$ & $(71.92\%)$ & $(80.68\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.2}
            &41.93 & 28.24 & 21.01 & 16.67 & 13.81 & 11.79 & 10.3 & 9.14 & 8.23 & 7.49\\
            &
            &$(4.47\%)$ & $(0\%)$ & $(1.87\%)$ & $(5.8\%)$ & $(10.59\%)$ & $(15.78\%)$ & $(21.12\%)$ & $(26.52\%)$ & $(31.89\%)$ & $(37.21\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.3}
            &44.58 & 28.74 & 20.63 & 15.92 & 12.92 & 10.86 & 9.36 & 8.24 & 7.36 & 6.66\\
            &
            & $(11.06\%)$ & $(1.78\%)$ & $(0\%)$ & $(1.03\%)$ & $(3.44\%)$ & $(6.6\%)$ & $(10.17\%)$ & $(13.99\%)$ & $(17.93\%)$ & $(21.93\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.4}
            &47.1 & 29.74 & 20.84 & 15.76 & 12.57 & 10.43 & 8.91 & 7.77 & 6.9 & 6.21\\
            &
            & $(17.35\%)$ & $(5.31\%)$ & $(1.05\%)$ & $(0\%)$ & $(0.69\%)$ & $(2.42\%)$ & $(4.77\%)$ & $(7.52\%)$ & $(10.52\%)$ & $(13.67\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.5}
            &49.41 & 30.93 & 21.34 & 15.88 & 12.49 & 10.24 & 8.66 & 7.5 & 6.61 & 5.92\\
            &
            & $(23.09\%)$ & $(9.52\%)$ & $(3.47\%)$ & $(0.74\%)$ & $(0\%)$ & $(0.52\%)$ & $(1.85\%)$ & $(3.73\%)$ & $(5.96\%)$ & $(8.43\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.6}
            &51.51 & 32.2 & 22.01 & 16.17 & 12.56 & 10.18 & 8.53 & 7.34 & 6.43 & 5.73\\
            &
            & $(28.32\%)$ & $(14.05\%)$ & $(6.7\%)$ & $(2.58\%)$ & $(0.58\%)$ & $(0\%)$ & $(0.41\%)$ & $(1.49\%)$ & $(3.03\%)$ & $(4.9\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.7}
            &53.43 & 33.52 & 22.79 & 16.58 & 12.74 & 10.23 & 8.5 & 7.25 & 6.32 & 5.6\\
            &
            & $(33.12\%)$ & $(18.72\%)$ & $(10.46\%)$ & $(5.2\%)$ & $(2.06\%)$ & $(0.47\%)$ & $(0\%)$ & $(0.33\%)$ & $(1.23\%)$ & $(2.54\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.8}
            &55.21 & 34.85 & 23.64 & 17.08 & 13.02 & 10.36 & 8.53 & 7.23 & 6.26 & 5.52\\
            &
            & $(37.55\%)$ & $(23.43\%)$ & $(14.6\%)$ & $(8.39\%)$ & $(4.24\%)$ & $(1.7\%)$ & $(0.39\%)$ & $(0\%)$ & $(0.28\%)$ & $(1.04\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.9}
            &56.86 & 36.18 & 24.55 & 17.66 & 13.36 & 10.55 & 8.62 & 7.25 & 6.24 & 5.47\\
            &
            & $(41.65\%)$ & $(28.13\%)$ & $(19.01\%)$ & $(12.04\%)$ & $(6.98\%)$ & $(3.56\%)$ & $(1.44\%)$ & $(0.34\%)$ & $(0\%)$ & $(0.23\%)$\\
 \cmidrule{2-12}
              &\multirow{2}{*}{1.0}
            &58.39 & 37.5 & 25.49 & 18.29 & 13.76 & 10.79 & 8.76 & 7.32 & 6.26 & 5.46\\
            &
            & $(45.48\%)$ & $(32.79\%)$ & $(23.59\%)$ & $(16.05\%)$ & $(10.19\%)$ & $(5.94\%)$ & $(3.05\%)$ & $(1.25\%)$ & $(0.3\%)$ & $(0\%)$\\
      \bottomrule
      \end{tabularx}
    } % endof \scalebox
\end{table}

this is what it produces

LaTeX output

The "issue" is that the vertical text (bbbbbb...) in the first column is centered according to the height of the entire table. I'd like to drag the text down a bit so as to get it centered according the the combined height of the rows 0.1 through 1.0 right to next to the first column. Would appreciate any help.

  • Since you're using booktabs, the traditional space between each row with a rule is different (more spaced out). As such, "20 rows" from the top should actually be "20 rows + 9 rule height adjustments". You might be better off by placing the vertical text in line 0.5 or 0.6 and shifting it down or up accordingly. – Werner Jun 8 '14 at 14:39
1

You can use the second optional argument of the \multirow macro, which is fixup. Any negative length will put the text down:

\multirow{nrows}[bigstruts]{width}[fixup]{text}

like

\parbox[t]{3mm}{\multirow{20}{*}[-1.5ex]{\rotatebox[origin=c]{90}
                {bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}}}

Adjust -1.5ex to suit your needs.

\documentclass[11pt]{article}

\usepackage{rotating}

\usepackage[
    lmargin=1.0in,
    rmargin=1.0in,
    tmargin=2.0cm,
    bmargin=2.0cm
]{geometry}

\usepackage{tabularx, booktabs}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

\usepackage{multirow}

\begin{document}

\begin{table}
    \centering
    % table caption is to be above the table
    \caption{Table title.}
    \scalebox{0.65}{
    \begin{tabularx}{1.5\textwidth}{ll *{10}{Y}}
    \toprule
      & & \multicolumn{10}{c}{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}\\[2mm]
      & & 0.1 & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 & 0.7 & 0.8 & 0.9 & 1.0\\
    \cmidrule[0.6pt]{3-12}
        \parbox[t]{3mm}{\multirow{20}{*}[-1.5ex]{\rotatebox[origin=c]{90}{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}}}
            &\multirow{2}{*}{0.1}
            &40.14 & 29.7 & 23.58 & 19.57 & 16.75 & 14.67 & 13.05 & 11.77 & 10.73 & 9.86\\
            &
            &$(0\%)$ & $(5.18\%)$ & $(14.29\%)$ & $(24.2\%)$ & $(34.18\%)$ & $(44.0\%)$ & $(53.58\%)$ & $(62.89\%)$ & $(71.92\%)$ & $(80.68\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.2}
            &41.93 & 28.24 & 21.01 & 16.67 & 13.81 & 11.79 & 10.3 & 9.14 & 8.23 & 7.49\\
            &
            &$(4.47\%)$ & $(0\%)$ & $(1.87\%)$ & $(5.8\%)$ & $(10.59\%)$ & $(15.78\%)$ & $(21.12\%)$ & $(26.52\%)$ & $(31.89\%)$ & $(37.21\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.3}
            &44.58 & 28.74 & 20.63 & 15.92 & 12.92 & 10.86 & 9.36 & 8.24 & 7.36 & 6.66\\
            &
            & $(11.06\%)$ & $(1.78\%)$ & $(0\%)$ & $(1.03\%)$ & $(3.44\%)$ & $(6.6\%)$ & $(10.17\%)$ & $(13.99\%)$ & $(17.93\%)$ & $(21.93\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.4}
            &47.1 & 29.74 & 20.84 & 15.76 & 12.57 & 10.43 & 8.91 & 7.77 & 6.9 & 6.21\\
            &
            & $(17.35\%)$ & $(5.31\%)$ & $(1.05\%)$ & $(0\%)$ & $(0.69\%)$ & $(2.42\%)$ & $(4.77\%)$ & $(7.52\%)$ & $(10.52\%)$ & $(13.67\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.5}
            &49.41 & 30.93 & 21.34 & 15.88 & 12.49 & 10.24 & 8.66 & 7.5 & 6.61 & 5.92\\
            &
            & $(23.09\%)$ & $(9.52\%)$ & $(3.47\%)$ & $(0.74\%)$ & $(0\%)$ & $(0.52\%)$ & $(1.85\%)$ & $(3.73\%)$ & $(5.96\%)$ & $(8.43\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.6}
            &51.51 & 32.2 & 22.01 & 16.17 & 12.56 & 10.18 & 8.53 & 7.34 & 6.43 & 5.73\\
            &
            & $(28.32\%)$ & $(14.05\%)$ & $(6.7\%)$ & $(2.58\%)$ & $(0.58\%)$ & $(0\%)$ & $(0.41\%)$ & $(1.49\%)$ & $(3.03\%)$ & $(4.9\%)$\\
\cmidrule{2-12}
            &\multirow{2}{*}{0.7}
            &53.43 & 33.52 & 22.79 & 16.58 & 12.74 & 10.23 & 8.5 & 7.25 & 6.32 & 5.6\\
            &
            & $(33.12\%)$ & $(18.72\%)$ & $(10.46\%)$ & $(5.2\%)$ & $(2.06\%)$ & $(0.47\%)$ & $(0\%)$ & $(0.33\%)$ & $(1.23\%)$ & $(2.54\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.8}
            &55.21 & 34.85 & 23.64 & 17.08 & 13.02 & 10.36 & 8.53 & 7.23 & 6.26 & 5.52\\
            &
            & $(37.55\%)$ & $(23.43\%)$ & $(14.6\%)$ & $(8.39\%)$ & $(4.24\%)$ & $(1.7\%)$ & $(0.39\%)$ & $(0\%)$ & $(0.28\%)$ & $(1.04\%)$\\
 \cmidrule{2-12}
            &\multirow{2}{*}{0.9}
            &56.86 & 36.18 & 24.55 & 17.66 & 13.36 & 10.55 & 8.62 & 7.25 & 6.24 & 5.47\\
            &
            & $(41.65\%)$ & $(28.13\%)$ & $(19.01\%)$ & $(12.04\%)$ & $(6.98\%)$ & $(3.56\%)$ & $(1.44\%)$ & $(0.34\%)$ & $(0\%)$ & $(0.23\%)$\\
 \cmidrule{2-12}
              &\multirow{2}{*}{1.0}
            &58.39 & 37.5 & 25.49 & 18.29 & 13.76 & 10.79 & 8.76 & 7.32 & 6.26 & 5.46\\
            &
            & $(45.48\%)$ & $(32.79\%)$ & $(23.59\%)$ & $(16.05\%)$ & $(10.19\%)$ & $(5.94\%)$ & $(3.05\%)$ & $(1.25\%)$ & $(0.3\%)$ & $(0\%)$\\
      \bottomrule
      \end{tabularx}
    } % endof \scalebox
\end{table}
\end{document}

enter image description here

1

I simplified your code, and used the siunitx package, in order to have data aligned on the decimal dot, with the S column type. To have the vertical text vertically centred, it suffices to indicate to the multirow environment another value for the number of rows; in the present case, 24 instead of 20, plus a small white space, will do the trick. Also, instead of using \scalebox I set font size to \footnotesize and \ tabcolsep to 3pt. If you find 3pt is not enough, you can set font size to \scriptsize and \tabcolsep to 5pt.

\documentclass[11pt]{article}

\usepackage{rotating}

\usepackage[
 lmargin=1.0in,
 rmargin=1.0in,
 tmargin=2.0cm,
 bmargin=2.0cm
]{geometry}
\usepackage{siunitx}
\usepackage{tabularx, booktabs}
\newcolumntype{Y}{S}%{>{\centering\arraybackslash}X}
\usepackage{geometry}
\usepackage{multirow}
\usepackage{caption}
\geometry{showframe, nomarginpar}

\begin{document}

Text text text text text text text text text text text text text text text text text text text text text text text text text.

\begin{table}[!h]
    \centering
    % table caption is to be above the table
    \caption{Table title.}
\footnotesize\setlength\tabcolsep{3pt}
    \begin{tabularx}{\linewidth}{@{}l@{\quad}l *{10}{Y}@{}}
    \toprule
       & & \multicolumn{10}{c}{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}\\[2mm]
       & & 0.1 & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 & 0.7 & 0.8 & 0.9 & 1.0\\
    \cmidrule[0.6pt]{3-12}%
\multirow{24}{*}{\rotatebox{90}{{Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\hskip1.5em}}} & \multirow{2}{*}{0.1}
             & 40.14 & 29.7 & 23.58 & 19.57 & 16.75 & 14.67 & 13.05 & 11.77 & 10.73 & 9.86\\
             &
             & {(0\,\%)} & {(5.18\,\%)} & {(14.29\,\%)} & {(24.2\,\%)} & {(34.18\,\%)} & {(44.0\,\%)} & {(53.58\,\%)} & {(62.89\,\%)} & {(71.92\,\%)} & {(80.68\,\%)}\\
\cmidrule{2-12}
  & \multirow{2}{*}{0.2}
  & 41.93 & 28.24 & 21.01 & 16.67 & 13.81 & 11.79 & 10.3 & 9.14 & 8.23 & 7.49\\
  &
  &{(4.47\,\%)} &{(0\,\%)} &{(1.87\,\%)} &{(5.8\,\%)} &{(10.59\,\%)} &{(15.78\,\%)} &{(21.12\,\%)} &{(26.52\,\%)} &{(31.89\,\%)} &{(37.21\,\%)}\\
\cmidrule{2-12}
  & \multirow{2}{*}{0.3}
  & 44.58 & 28.74 & 20.63 & 15.92 & 12.92 & 10.86 & 9.36 & 8.24 & 7.36 & 6.66\\
  &
  &{(11.06\,\%)} &{(1.78\,\%)} &{(0\,\%)} &{(1.03\,\%)} &{(3.44\,\%)} &{(6.6\,\%)} &{(10.17\,\%)} &{(13.99\,\%)} &{(17.93\,\%)} &{(21.93\,\%)}\\
 \cmidrule{2-12}
  & \multirow{2}{*}{0.4}
  & 47.1 & 29.74 & 20.84 & 15.76 & 12.57 & 10.43 & 8.91 & 7.77 & 6.9 & 6.21\\
  &
  &{(17.35\,\%)} &{(5.31\,\%)} &{(1.05\,\%)} &{(0\,\%)} &{(0.69\,\%)} &{(2.42\,\%)} &{(4.77\,\%)} &{(7.52\,\%)} &{(10.52\,\%)} &{(13.67\,\%)}\\
\cmidrule{2-12}
  & \multirow{2}{*}{0.5}
  & 49.41 & 30.93 & 21.34 & 15.88 & 12.49 & 10.24 & 8.66 & 7.5 & 6.61 & 5.92\\
  &
  &{(23.09\,\%)} &{(9.52\,\%)} &{(3.47\,\%)} &{(0.74\,\%)} &{(0\,\%)} &{(0.52\,\%)} &{(1.85\,\%)} &{(3.73\,\%)} &{(5.96\,\%)} &{(8.43\,\%)}\\
\cmidrule{2-12}
  & \multirow{2}{*}{0.6}
  & 51.51 & 32.2 & 22.01 & 16.17 & 12.56 & 10.18 & 8.53 & 7.34 & 6.43 & 5.73\\
  &
  &{(28.32\,\%)} &{(14.05\,\%)} &{(6.7\,\%)} &{(2.58\,\%)} &{(0.58\,\%)} &{(0\,\%)} &{(0.41\,\%)} &{(1.49\,\%)} &{(3.03\,\%)} &{(4.9\,\%)}\\
\cmidrule{2-12}
  & \multirow{2}{*}{0.7}
  & 53.43 & 33.52 & 22.79 & 16.58 & 12.74 & 10.23 & 8.5 & 7.25 & 6.32 & 5.6\\
  &
  &{(33.12\,\%)} &{(18.72\,\%)} &{(10.46\,\%)} &{(5.2\,\%)} &{(2.06\,\%)} &{(0.47\,\%)} &{(0\,\%)} &{(0.33\,\%)} &{(1.23\,\%)} &{(2.54\,\%)}\\
 \cmidrule{2-12}
  & \multirow{2}{*}{0.8}
  & 55.21 & 34.85 & 23.64 & 17.08 & 13.02 & 10.36 & 8.53 & 7.23 & 6.26 & 5.52\\
  &
  &{(37.55\,\%)} &{(23.43\,\%)} &{(14.6\,\%)} &{(8.39\,\%)} &{(4.24\,\%)} &{(1.7\,\%)} &{(0.39\,\%)} &{(0\,\%)} &{(0.28\,\%)} &{(1.04\,\%)}\\
 \cmidrule{2-12}
  & \multirow{2}{*}{0.9}
  & 56.86 & 36.18 & 24.55 & 17.66 & 13.36 & 10.55 & 8.62 & 7.25 & 6.24 & 5.47\\
  &
  &{(41.65\,\%)} &{(28.13\,\%)} &{(19.01\,\%)} &{(12.04\,\%)} &{(6.98\,\%)} &{(3.56\,\%)} &{(1.44\,\%)} &{(0.34\,\%)} &{(0\,\%)} &{(0.23\,\%)}\\
 \cmidrule{2-12}
  & \multirow{2}{*}{1.0}
  & 58.39 & 37.5 & 25.49 & 18.29 & 13.76 & 10.79 & 8.76 & 7.32 & 6.26 & 5.46\\
  &
  &{(45.48\,\%)} &{(32.79\,\%)} &{(23.59\,\%)} &{(16.05\,\%)} &{(10.19\,\%)} &{(5.94\,\%)} &{(3.05\,\%)} &{(1.25\,\%)} &{(0.3\,\%)} &{(0\,\%)}\\
      \bottomrule
      \end{tabularx}
\end{table}
\noindent Text text text text text text text text text text text text text text text text text text text text text text text text text.
\end{document} 

enter image description here

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.