我一直尝试使用以下代码创建一个表格,但该表格超出了页面范围(水平):
\begin{table} [!htbp]
\centering
\begin{tabular}{lccccc}
\toprule
Variable & No. of Observations & Mean & Std. Deviation & Minimum & Maximum\\
\midrule
Unpaid Household Work & 343,59 & 665.55 & 359.82 & 0 & 2820\\
Unpaid Care Work & 343,678 & 128.49 & 211.72 & 0 & 1650\\
Unpaid Domestic Work & 343,706 & 538.43 & 243.05 & 0 & 2130\\
Dependency Ratio & 335,726 & 0.19 & 0.41 & 0 & 18\\
Sex Ratio & 324,363 & 1.43 & 0.99 & 0 & 7.41\\
Monthly Consumption Expenditure (INR) & 344,926 & 12975.12 & 7955.47 & 700 & 131833\\
\bottomrule
\end{tabular}
\caption{Summary Statistics of All Continuous Variables.}
\end{table}
答案1
我建议您从 a 切换tabular
到 atabularx
环境(目标宽度为\textwidth
),然后(a)允许在第一列自动换行,(b)缩写 5 个数据列标题中的 4 个。
\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx,ragged2e}
% 'L' column type: suppress full justification, perform hanging indentation
\newcolumntype{L}{>{\RaggedRight \hangafter=1 \hangindent=1em}X}
\begin{document}
\begin{table} [!htbp]
\begin{tabularx}{\textwidth}{@{} L ccccc @{}}
\toprule
Variable & No.\ of Obs. & Mean & St.\ Dev. & Min. & Max. \\
\midrule
Unpaid household work & 343,59 & 665.55 & 359.82 & 0 & 2820\\
Unpaid care work & 343,678 & 128.49 & 211.72 & 0 & 1650\\
Unpaid domestic work & 343,706 & 538.43 & 243.05 & 0 & 2130\\
Dependency ratio & 335,726 & 0.19 & 0.41 & 0 & 18\\
Sex ratio & 324,363 & 1.43 & 0.99 & 0 & 7.41\\
Monthly consumption expenditure (INR) & 344,926 & 12975.12 & 7955.47 & 700 & 131833\\
\bottomrule
\end{tabularx}
\caption{Summary statistics of all continuous variables.}
\end{table}
\end{document}