
私は上記のような表を作成しようとしていますが、Females と Males の下に 2 つではなく 5 つの変数があります。また、Treatment の下には 3 つ以上ありますが、それほど重要ではありません。私のコードは で問題が発生し続けます\cline
。7 は空白の列なので、水平線は列 2 から 6 および 8 から 12 にまたがっているという意味ではないでしょうか。
\begin{table}[h]
\begin{tabular}{lcccccccccc}
\hline
\multicolumn{5}{c}{Females} & & \multicolumn{5}{c}{Males} \\
\cline{2-6} \cline{8-12}
Treatment & V1 & V2 & V3 & V4 & V5 & & V1 & V2 & V3 & V4 & V5 \\
Placebo & 0.21 & 163 & 3 & 4 & 5 & & 0.22 & 164 & 3 & 4 & 5 \\
ACE Inhibitor & 0.13 & 142 & 3 & 4 & 5 & & 0.15 & 144 & 3 & 4 & 5 \\
Hydralazine & 0.17 & 143 & 3 & 4 & 5 & & 0.16 & 140 & 3 & 4 & 5 \\
\begin{tabular}
\end{table}
答え1
2 つの部分を分離するためにダミー列を使用しているようです。 の引数でそれを指定する必要があります\begin{tabular}
。
\documentclass{article}
\begin{document}
\begin{tabular}{lccccc c ccccc}
\hline
& \multicolumn{5}{c}{Females} && \multicolumn{5}{c}{Males} \\
\cline{2-6} \cline{8-12}
Treatment & V1 & V2 & V3 & V4 & V5 && V1 & V2 & V3 & V4 & V5 \\
Placebo & 0.21 & 163 & 3 & 4 & 5 && 0.22 & 164 & 3 & 4 & 5 \\
ACE Inhibitor & 0.13 & 142 & 3 & 4 & 5 && 0.15 & 144 & 3 & 4 & 5 \\
Hydralazine & 0.17 & 143 & 3 & 4 & 5 && 0.16 & 140 & 3 & 4 & 5 \\
\end{tabular}
\end{document}
しかし、もっと良い方法があります。
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{l ccccc ccccc}
\toprule
& \multicolumn{5}{c}{Females} & \multicolumn{5}{c}{Males} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-11}
Treatment & V1 & V2 & V3 & V4 & V5 & V1 & V2 & V3 & V4 & V5 \\
\midrule
Placebo & 0.21 & 163 & 3 & 4 & 5 & 0.22 & 164 & 3 & 4 & 5 \\
ACE Inhibitor & 0.13 & 142 & 3 & 4 & 5 & 0.15 & 144 & 3 & 4 & 5 \\
Hydralazine & 0.17 & 143 & 3 & 4 & 5 & 0.16 & 140 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
\end{document}