答案1
我会选择tabularx
,booktabs
并且siunitx
按以下顺序进行:
- 将提供自适应“X”柱
- 将提供专业的桌位规则
S
将为表格提供“点对齐”列
还要注意,“标准差”列最适合紧凑(与下面的数字相比,标准差是一个很长的文本;尝试更改它),但我将其排版为一p
列。
我还插入了arraystretch
在行间添加垂直空间
然后
\documentclass{article}
\usepackage{booktabs,tabularx}
\usepackage[input-decimal-markers=.]{siunitx}
\usepackage{lipsum}
\begin{document}
\begin{table}
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{@{}lXSS@{}}
\toprule
\multicolumn{1}{l}{Variable}&\multicolumn{1}{l}{Description}&\multicolumn{1}{r}{Mean}&\multicolumn{1}{p{1.5cm}}{Standard deviation}\\
\midrule
Health&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&0.8049&0.3928\\
Age&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&49.16&15.82\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
得到: