答案1
创建与问题中显示的表格类似的表格的 MWE 将是以下代码:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\caption{Types of Employment as Percentage of Sample Population}
\centering
\begin{tabular}{lrrr}
\toprule
& \textit{1999} & \textit{2004} & \textit{2006} \\
\midrule
Family agriculture & 30.8 & 36.60 & 37.80 \\
Nonagriculture self-employed & 24.1 & 25.80 & 22.90 \\
Nonagriculture unpaid family work & 0 & 0.08 & 0.06 \\
Wage employment & 15.0 & 10.40 & 10.00 \\
Apprenticeship & 2.1 & 1.10 & 1.90 \\
Unemployed & 1.7 & 2.40 & 1.90 \\
Not in the labor force & 26.4 & 23.70 & 25.50 \\
\bottomrule
\footnotesize Source:
\end{tabular}
\end{table}
\end{document}
您可能需要考虑根据小数点分隔符对齐数字,而不是右对齐。这可以借助包轻松实现,siunitx
如以下示例所示:
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}
\caption{Types of Employment as Percentage of Sample Population}
\centering
\begin{tabular}{l*3S[table-format=2.2]}
\toprule
& \textit{1999} & \textit{2004} & \textit{2006} \\
\midrule
Family agriculture & 30.8 & 36.60 & 37.80 \\
Nonagriculture self-employed & 24.1 & 25.80 & 22.90 \\
Nonagriculture unpaid family work & 0 & 0.08 & 0.06 \\
Wage employment & 15.0 & 10.40 & 10.00 \\
Apprenticeship & 2.1 & 1.10 & 1.90 \\
Unemployed & 1.7 & 2.40 & 1.90 \\
Not in the labor force & 26.4 & 23.70 & 25.50 \\
\bottomrule
\footnotesize Source:
\end{tabular}
\end{table}
\end{document}