有人能帮我把爬升/下降率列的元素集中起来吗?点和数字必须垂直对齐
\begin{tabular}{c c c r@{}l r@{}l c }
\hline
Description &
Start Altitude &
End Altitude &
\multicolumn{2}{c}{Air Speed} &
\multicolumn{2}{c}{Climb/Descent Rate} &
\multicolumn{1}{c}{Distance}\\
\hline
Units & km & km & \multicolumn{2}{c}{m/s} & \multicolumn{2}{c}{m/s} & \multicolumn{1}{c}{km}\\
\hline
First Climb & $0.0$ & $2.0$ & $110$ & $.000$ & $6$ & $.0$ & $-$\\
Second Climb & $2.0$ & $4.5$ & $120$ & $.000$ & $6$ & $.0$ & $-$\\
Third Climb & $4.5$ & $5.0$ & $135$ & $.000$ & $3$ & $.0$ & $-$\\
Cruise & $5.0$ & $5.0$ & $135$ & $.278$ & $0$ & $.0$ & $1740.88$\\
First Descent & $5.0$ & $4.5$ & $130$ & $.000$ & $-4$ & $.5$ & $-$\\
Second Descent & $4.5$ & $4.0$ & $120$ & $.000$ & $-5$ & $.0$ & $-$\\
Third Descent & $4.0$ & $3.0$ & $115$ & $.000$ & $-5$ & $.0$ & $-$\\
Fourth Descent & $3.0$ & $2.0$ & $110$ & $.000$ & $-5$ & $.0$ & $-$\\
Fifth Descent & $2.0$ & $0.0$ & $100$ & $.000$ & $-3$ & $.0$ & $-$\\
\end{tabular}
\end{center}
\end{table}
答案1
借助该siunitx
包及其S
类型列,您可以轻松地根据小数点标记对齐数字,而无需使用两列:
\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\begin{document}
\begin{table}
\centering
\begin{tabular}{l
S[table-format=1.1]
S[table-format=1.1]
S[table-format=3.3]
S[table-format=-1.1]
S[table-format=4.2]}
\toprule
Description &
{Start Altitude} &
{End Altitude} &
{Air Speed} &
{Climb/Descent Rate} &
{Distance}\\
Units & \si{\km} & \si{\km} & \si{\m\per\s} & \si{\m\per\s} & \si{\km}\\
\midrule
First Climb & 0.0 & 2.0 & 110.000 & 6.0 & {-} \\
Second Climb & 2.0 & 4.5 & 120.000 & 6.0 & {-} \\
Third Climb & 4.5 & 5.0 & 135.000 & 3.0 & {-} \\
Cruise & 5.0 & 5.0 & 135.278 & 0.0 & 1740.88 \\
First Descent & 5.0 & 4.5 & 130.000 & -4.5 & {-} \\
Second Descent & 4.5 & 4.0 & 120.000 & -5.0 & {-} \\
Third Descent & 4.0 & 3.0 & 115.000 & -5.0 & {-} \\
Fourth Descent & 3.0 & 2.0 & 110.000 & -5.0 & {-} \\
Fifth Descent & 2.0 & 0.0 & 100.000 & -3.0 & {-} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}