我正在尝试制作这张表:
\begin{table}[]
\centering
\caption{}
\label{tab:my-table}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{lcccc}
\hline
& \multicolumn{4}{c}{Stacked Differences, 1990-2000 and 2000-2007} \\ \cline{2-5}
& (1) & (2) & (3) & (4) \\ \hline
& \multicolumn{4}{c}{A. Change in Private Employment-to-Population Ratio -- All} \\ \cline{2-5}
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\ \cline{2-5}
& \multicolumn{4}{c}{B. Change in Private Employment-to-Population Ratio -- Women} \\ \cline{2-5}
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\ \cline{2-5}
& \multicolumn{4}{c}{C. Change in Private Employment-to-Population Ratio -- Men} \\ \cline{2-5}
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\ \cline{2-5}
& \multicolumn{4}{c}{Covariates} \\ \cline{2-5}
Time Dummies and Census Divisions & Yes & Yes & Yes & Yes \\
Demographics & No & Yes & Yes & Yes \\
Industry Shares & No & No & Yes & Yes \\
Trade, Routine Jobs & No & No & No & Yes \\ \hline
\end{tabular}%
}
\end{table}
输出为:
如何使列(2-5)的宽度相等?
答案1
我建议您首先将所有 实例更改为& \multicolumn{4}{c}
。\multicolumn{5}{@{}l@{}}
然后,删除\resizebox
指令并插入\centering
指令。或者,加载包booktabs
,删除指令,并根据需要将\cline
的实例替换为和。\hline
\toprule
\bottomrule
\documentclass{article}
\usepackage{booktabs} % for well-spaced horizontal rules
\begin{document}
\begin{table}
\centering
\caption{Stacked Differences, 1990--2000 and 2000--2007\strut}
\label{tab:my-table}
\begin{tabular}{@{} lcccc @{}}
\toprule
& (1) & (2) & (3) & (4) \\
\cmidrule(l){2-5}
\multicolumn{5}{@{}l@{}}{A. Change in Private Employment-to-Population Ratio -- All} \\
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\
\addlinespace % add a bit of vertical whitespace
\multicolumn{5}{@{}l@{}}{B. Change in Private Employment-to-Population Ratio -- Women} \\
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\
\addlinespace
\multicolumn{5}{@{}l@{}}{C. Change in Private Employment-to-Population Ratio -- Men} \\
Adjusted EURO5 Exposure to Robots & 0.00 & 0.00 & 0.00 & 0.00 \\
& 0.00 & 0.00 & 0.00 & 0.00 \\
Observations & 0.00 & 0.00 & 0.00 & 0.00 \\
R-squared & 0.00 & 0.00 & 0.00 & 0.00 \\
\addlinespace
\multicolumn{5}{@{}l@{}}{Covariates} \\
Time Dummies and Census Divisions & Yes & Yes & Yes & Yes \\
Demographics & No & Yes & Yes & Yes \\
Industry Shares & No & No & Yes & Yes \\
Trade, Routine Jobs & No & No & No & Yes \\
\bottomrule
\end{tabular}
\end{table}
\end{document}