\begin{table}[H]
\centering
\sisetup{table-format=1.3e-2, table-alignment=center, tight-spacing}
\setlength{\tabcolsep}{3pt}
\small
\centering
\begin{tabularx}{\linewidth}{X cSS[table-format=1.5] SS[table-format=1.5]}
\toprule
ID & {ABC Dataset Name} & {$X^2$ (XXX)} & {$Y^2$ (YYYY)} \\ [0.5ex]
\midrule
DS1 & ABCDE ABCD & 0.0243 & 0.2039 \\
DS2 & ABCD & 0.0594 & 0.0015 \\
DS3 & XYZE & 0.2318 & 0.7709 \\
DS4 & ABC ABC & 0.1555 & 0.5613 \\ [1ex]
\bottomrule
\end{tabularx}
\caption{11 my caption}
\label{table:3}
\end{table}
答案1
像这样?
- 对于你的表我不会使用
tabularx
环境,在你的情况下更好tabular
- 您定义了 6 列,但只使用了 4 列。在下面的 mwe 中,我删除了多余的列
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}
\centering
\centering
\begin{tabular}{l c *{2}{S[table-format=1.4]}}
\toprule
ID & ABC Dataset Name & {$X^2$ (XXX)} & {$Y^2$ (YYYY)} \\
\midrule
DS1 & ABCDE ABCD & 0.0243 & 0.2039 \\
DS2 & ABCD & 0.0594 & 0.0015 \\
DS3 & XYZE & 0.2318 & 0.7709 \\
DS4 & ABC ABC & 0.1555 & 0.5613 \\
\bottomrule
\end{tabular}
\caption{11 my caption}
\label{table:3}
\end{table}
\end{document}