答案1
一些指示:
加载
booktabs
包并使用宏\toprule
、、\midrule
和生成间距适当\bottomrule
的\cmidrule
水平线。加载
dcolumn
包以使数据列中的数字与小数点标记对齐。使用
\multicolumn{.}{.}{.}
指令合并单元格和/或更改给定单元格的列类型。
\documentclass{article}
\usepackage{booktabs,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\begin{document}
\setcounter{table}{4} % just for this example
\begin{table}
\caption{Logistic regression estimates of support for rebel groups}
\centering
\begin{tabular}{ @{} l *{4}{d{3.6}} @{} } % 1 "l" column, 4 "d" columns
\toprule
& \multicolumn{2}{c}{Support I} % combine 2 columns, use "c" column type
& \multicolumn{1}{c}{Support II} % change column type from "d" to "c"
& \multicolumn{1}{c@{}}{Support III} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-4} \cmidrule(l){5-5}
& \multicolumn{1}{c}{(1)} % change column type from "d" to "c"
& \multicolumn{1}{c}{(2)}
& \multicolumn{1}{c}{(3)}
& \multicolumn{1}{c@{}}{(4)} \\
\midrule
Rebels much weaker & -0.408 && -0.524^{*} & -0.564^{*} \\
& (0.305) & & (0.318) & (0.323) \\
\dots \\
\addlinespace
\emph{AIC} & 386.471 & 510.461 & 363.585 & 347.002\\
\bottomrule
\end{tabular}
\end{table}
\end{document}
附录回答 OP 在评论中提出的问题。我理解您的评论是希望有一个名为“支持 II”的标题,该标题跨越第 4 列和第 5 列,并希望删除位于第 5 列上的名为“支持 III”的标题。
如果这种解释是正确的,您应该(a)\multicolumn{1}{c}{Support II}
用替换\multicolumn{2}{c@{}}{Support II}
,(b)省略& \multicolumn{1}{c@{}}{Support III}
,以及(c)\cmidrule(lr){4-4} \cmidrule(l){5-5}
用替换\cmidrule(l){4-5}
,即将两个单列宽规则替换为跨越第 4 列和第 5 列的规则。
\documentclass{article}
\usepackage{booktabs,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\begin{document}
\setcounter{table}{4} % just for this example
\begin{table}
\caption{Logistic regression estimates of support for rebel groups}
\centering
\begin{tabular}{ @{} l *{4}{d{3.6}} @{} }
\toprule
& \multicolumn{2}{c}{Support I}
& \multicolumn{2}{c@{}}{Support II} \\
\cmidrule(lr){2-3} \cmidrule(l){4-5}
& \multicolumn{1}{c}{(1)}
& \multicolumn{1}{c}{(2)}
& \multicolumn{1}{c}{(3)}
& \multicolumn{1}{c@{}}{(4)} \\
\midrule
Rebels much weaker & -0.408 && -0.524^{*} & -0.564^{*} \\
& (0.305) & & (0.318) & (0.323) \\
\dots \\
\addlinespace
\emph{AIC} & 386.471 & 510.461 & 363.585 & 347.002\\
\bottomrule
\end{tabular}
\end{table}
\end{document}