2

I have the following table: table It is very wide. How can I reduce its width?

\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
  • 2
    \begin{tabularx}{0.6\linewidth} perhaps, depending on the content.... that is what the 1st argument of the tabularx environment is meant for: Specification of table width, from which the space for the X columns is calculated. Please don't post such fragments only. Using \centering in a \linewidth wide table is also pretty useless – user31729 Jan 1 '18 at 8:08
6

like this?

enter image description here

  • for your table i wouldn't use tabularx environment, in your case is better tabular
  • you have defined 6 columns but you use only four. in mwe below i remove superfluous columns

\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}
1
  • 2
    @Mico, thank you ... is to early (for today) to me to observe, that op column definition not complain with numbers in them :-). corrected! happy new year to you too! – Zarko Jan 1 '18 at 8:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.