\cmidrule with two multirows not behaving correctly?
For having some space between two \cmidrule
s at the same level, you never want \morecmidrules
. Just use the ()
optional argument to shorten the line, as in the following:
\begin{table}
\centering
\begin{tabular}{rrrrr}\toprule
$b$ & \multicolumn{2}{c}{QCDH} & Single & \smash[b]{$\frac{\pi_{q1}}{\pi_{s1}}$} \\
\cmidrule(r){2-3}\cmidrule(l){4-5} % notice there's no \\ here
& $\pi_{q1}$ & $\pi_{q1}$ & $\pi_{s1}$ & \\
\midrule[\heavyrulewidth] % notice there's no \\ here
0.1 & 0.0055 & 0.0018 & 0.0018 & 3.0555\\ \midrule
0.5 & 0.1218 & 0.0830 & 0.0074 & 16.4594\\ \midrule
2.5 & 0.7325 & 0.6771 & 0.3561 & 2.0570\\ \bottomrule
\end{tabular}
\caption{Pickup rates from QCDH and single SNP approach}
\end{table}
Integrating the functionality of the multirow
package with that of the booktabs
package is tricky: \midrule
and \cmidrule
add extra vertical spacing, but this extra spacing isn't taken into account when a \multirow
instruction is executed. Thus, lining up the material in a 2-row multirow that also features \midrule
or \cmidrule
between those two rows is rarely satisfactory.
Moreover, I'd say your table neither requires nor benefits from applying a \multirow
to the contents of columns 1 and 5 of the header. Just place those items in the very first row, and make the \cmidrule
span just columns 2 and 3.
I think it's in general a good idea to center the items in the header even if the material in the body of the table isn't (or shouldn't be) centered. Finally, since the data are numeric, it's probably also a good idea to align them on their decimal points.
\documentclass{article}
\usepackage{amsmath,booktabs,siunitx}
\begin{document}
\begin{table}
\centering
\begin{tabular}{S[table-format=1.1]
*{3}{S[table-format=1.4]}
S[table-format=2.4]}
\toprule
{b} & \multicolumn{2}{c}{QCDH} & {Single} & {$\dfrac{\pi_{q1}}{\pi_{s1}}$} \\
\cmidrule(lr){2-3}
& {$\pi_{q1}$} & {$\pi_{q1}$} & {$\pi_{s1}$} \\
\midrule
0.1 & 0.0055 & 0.0018 & 0.0018 & 3.0555\\
0.5 & 0.1218 & 0.0830 & 0.0074 & 16.4594\\
2.5 & 0.7325 & 0.6771 & 0.3561 & 2.0570\\
\bottomrule
\end{tabular}
\caption{Pickup rates from QCDH and single SNP approach}
\end{table}
\end{document}