我正在尝试创建一个类似于这样的表格,但我正在努力添加额外的文字
我想要实现的目标:
-------------------------------------------------------
Birth date
Name Surname day Month Year
-------------------------------------------------------
Jimmy Neutron 26 9 1834
Bob Ross 32 2 1234
-------------------------------------------------------
我现在拥有的:
\begin{table}[h!]
\centering
\begin{tabular}{ l r r l }
\toprule
& & Date \\
Name & Surname & day & month & year \\
\midrule
Jimmy & Neutron & 20 & 09 & 1984 \\
Bob & Ross & 2 & 12 & 1184 \\
\bottomrule
\end{tabular}
\caption{Body segment length measurements}
\end{table}
答案1
@Bernard 评论解决了您的问题,但是,在您的代码片段中,您定义了四列,但您需要五列。我建议按照以下示例所示更改它们的类型:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{ r l ccc }
\toprule
& & \multicolumn{3}{c}{Date} \\
\cmidrule{3-5}
Name & Surname & day & month & year \\
\midrule
Jimmy & Neutron & 20 & 09 & 1984 \\
Bob & Ross & 2 & 12 & 1184 \\
\bottomrule
\end{tabular}
\caption{Body segment length measurements}
\end{table}
\end{document}