对齐 S 型列标题

对齐 S 型列标题

我对下表标题的对齐方式非常不满意。我甚至尝试过使用\multicolumn,但没有任何效果。(如果有人知道表格的内容……是的,我对内容也不满意,哈哈!)

\documentclass{article}
\usepackage{siunitx}
\usepackage{rotating}
\sisetup{round-mode=figures, round-precision=3, scientific-notation=false}
\begin{sidewaystable}
    \centering
    \begin{tabular}{rrr@{}S[scientific-notation=true]@{}S[scientific-notation=true]rSS}
        \toprule
        $N$ & $P$ & $P^3$ & \multicolumn{1}{c}{$\Delta x$} & {$\Delta t$} & $n_t$ & {w.c.t. (\si{\minute})} & {Speed-up \si{\percent}}\\
        \midrule
        16 & 1 & 1 & 0.393 & 0.196078431 & 102 & 4.069515 &  \\
        32 & 2 & 8 & 0.196 & 0.0980392157 & 204 & 8.13903 & 1 \\
        48 & 3 & 27 & 0.131 & 0.0653594771 & 306 & 13.1286 & 0.929919793428088 \\
        64 & 4 & 64 & 0.0982 & 0.0490196078 & 408 & 28.5765 & 0.569630990499186 \\
        80 & 5 & 125 & 0.0785 & 0.0392156863 & 510 & 48.5749 & 0.418890723398298 \\
        96 & 6 & 216 & 0.0654 & 0.0326797386 & 612 & 87.7083 & 0.278389730504411 \\
        112 & 7 & 343 & 0.0561 & 0.0280112045 & 714 & 96.3564 & 0.295637912997995 \\
        128 & 8 & 512 & 0.0491 & 0.0245398773 & 815 & 197.87 & 0.164532875120028 \\
        \midrule
        32 & 1 & 1 & 0.196 & 0.0980392157 & 204 & 55.5835 &  \\
        64 & 2 & 8 & 0.0982 & 0.0490196078 & 408 & 111.167 & 1 \\
        96 & 3 & 27 & 0.0654 & 0.0326797386 & 612 & 197.713 & 0.843396741741818 \\
        128 & 4 & 64 & 0.0491 & 0.0245398773 & 815 & 415.779 & 0.534740811825513 \\
        160 & 5 & 125 & 0.0393 & 0.0196270854 & 1019 & 1076.27 & 0.258222843710221 \\
        192 & 6 & 216 & 0.0327 & 0.0163532298 & 1223 & 1867.37831666667 & 0.178593162951207 \\
        224 & 7 & 343 & 0.0280 & 0.0140154170 & 1427 & 2435.0328 & 0.159786143332443 \\
        256 & 8 & 512 & 0.0245 & 0.0122699387 & 1630 & 3343.32016666667 & 0.133001919598786 \\
        \bottomrule
    \end{tabular}
\end{sidewaystable}

在此处输入图片描述

答案1

指定每列的格式。

\documentclass{article}
\usepackage{siunitx}
\usepackage{rotating,booktabs}

\sisetup{
  round-mode=figures,
  round-precision=3,
  scientific-notation=false
}

\begin{document}

\begin{table}
\centering

\begin{tabular}{
 S[table-format=3.0]
 S[table-format=1.0]
 S[table-format=3.0]
 S[scientific-notation=true,table-format=1.2e-1]
 S[scientific-notation=true,table-format=1.2e-1]
 S[table-format=4.0]
 S[table-format=4.2]
 S[table-format=1.3]
}
\toprule
{$N$} &
{$P$} &
{$P^3$} &
{$\Delta x$} &
{$\Delta t$} &
{$n_t$} &
{w.c.t.} &
{Speed-up} \\
&&&&&& {\si{\minute}} & {\si{\percent}} \\
\midrule
16 & 1 & 1 & 0.393 & 0.196078431 & 102 & 4.069515 &  \\
32 & 2 & 8 & 0.196 & 0.0980392157 & 204 & 8.13903 & 1 \\
48 & 3 & 27 & 0.131 & 0.0653594771 & 306 & 13.1286 & 0.929919793428088 \\
64 & 4 & 64 & 0.0982 & 0.0490196078 & 408 & 28.5765 & 0.569630990499186 \\
80 & 5 & 125 & 0.0785 & 0.0392156863 & 510 & 48.5749 & 0.418890723398298 \\
96 & 6 & 216 & 0.0654 & 0.0326797386 & 612 & 87.7083 & 0.278389730504411 \\
112 & 7 & 343 & 0.0561 & 0.0280112045 & 714 & 96.3564 & 0.295637912997995 \\
128 & 8 & 512 & 0.0491 & 0.0245398773 & 815 & 197.87 & 0.164532875120028 \\
\midrule
32 & 1 & 1 & 0.196 & 0.0980392157 & 204 & 55.5835 &  \\
64 & 2 & 8 & 0.0982 & 0.0490196078 & 408 & 111.167 & 1 \\
96 & 3 & 27 & 0.0654 & 0.0326797386 & 612 & 197.713 & 0.843396741741818 \\
128 & 4 & 64 & 0.0491 & 0.0245398773 & 815 & 415.779 & 0.534740811825513 \\
160 & 5 & 125 & 0.0393 & 0.0196270854 & 1019 & 1076.27 & 0.258222843710221 \\
192 & 6 & 216 & 0.0327 & 0.0163532298 & 1223 & 1867.37831666667 & 0.178593162951207 \\
224 & 7 & 343 & 0.0280 & 0.0140154170 & 1427 & 2435.0328 & 0.159786143332443 \\
256 & 8 & 512 & 0.0245 & 0.0122699387 & 1630 & 3343.32016666667 & 0.133001919598786 \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

在此处输入图片描述

相关内容