桌子移到右側而不是居中

桌子移到右側而不是居中

我剛開始使用 LateX,無論如何,這張桌子都在右邊。如何利用左側空間將其置中? 程式碼 結果

答案1

\documentclass{article}
\usepackage{siunitx,booktabs}
\sisetup{uncertainty-mode=separate}

\begin{document}
    \begin{table}
        \centering
        \begin{tabular}{cSS}
            \toprule
            {$N$} & {diametro (\unit{\mm})} & {$\cos\theta$ ($\qty[print-unity-mantissa = false]{e-6}{\radian}$)} \\\midrule
            7 & 48\pm1 & 99990\pm1\\
            6 & 63\pm1&99983\pm1\\
            5&74\pm1&99977\pm1\\
            4&88\pm1&99967\pm1\\
            3&95\pm1&99962\pm1\\
            2&103\pm1&99955\pm1\\
            1&109\pm1&99949\pm1\\\bottomrule
        \end{tabular}
        \caption{Caption}
        \label{tab:my_label}
    \end{table}
\end{document}

結果

答案2

沒有交換列和行:

在此輸入影像描述

透過使用tabularray表格並在第一列中啟用兩行文字:


\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{table}
    \small
    \sisetup{uncertainty-mode = separate,
             tight-spacing}
\begin{tblr}{hline{1,2,Z},
             colspec = {@{} Q[c,m] *{7}{X[c, si={table-format=5.0(1)}]} @{}},
             colsep  = 3pt,
             row{1}  = {guard}
             }
$N$ & 7         &   6       &   5       &   4       &   3       &   2       &   1       \\ 
{diametro\\ (\unit{\mm})}
    & 48(1)     & 63(1)     & 74(1)     & 88(1)     & 95(1)     &103(1)     & 109(1)    \\
{$\cos\theta$\\ (\qty{e-6}{\radian})}
    & 99990(1)  & 99983(1)  & 99977(1)  & 99967(1)  & 99962(1)  & 99955(1)  & 99949(1)  \\
    \end{tblr}
\caption{Caption}
\label{tab:my_label}
    \end{table}
\end{document}

相關內容