[Tex/LaTex] Fitting table to half of the page using template

tables

Following
Table to fit the rest of the paper width
my question,
I use the amcs template amcs template
and the following:

\documentclass{amcs}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
%\documentclass{article}
\usepackage{adjustbox}
\usepackage{array,booktabs}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\documentclass{article}
    \usepackage{booktabs,makecell,tabularx}
    \renewcommand\theadfont{\small}
    \newcolumntype{L}{>{\raggedright\arraybackslash}X}
    \usepackage{siunitx}

\begin{document}
    \begin{table}[H]
    \centering
    \setlength{\tabcolsep}{1pt}
    \small
    \begin{tabularx}{\textwidth}{c L S[table-format=0.1]*{2}{S[table-format=0.1]}}
        \toprule
        \thead{ID}  &   \thead{UCI Dataset Name} 
        &   {\thead{Samples\\(number)}}
        &   {\thead{Attributes\\(number)}} 
        &   {\thead{Classes\\(number)}}           \\
        \midrule
        DS1 & Poker Hand                          & 1025010  & 11    & 9     \\
        DS2 & SUSY                                & 5000000  & 18    & 2     \\
        DS3 & Record Linkage Comparison  Patterns & 5749132  & 9     & 2     \\
        DS4 & KDD Cup 1999                        & 4898431  & 42    & 23    \\
        \bottomrule
    \end{tabularx}
    \caption{Datasets used for empirical evaluation}
    \label{table:1}
\end{table} 
 \end{document}

This is the result I get:
enter image description here
I need it to be in one column of the page. It is supposed to match into one column to the amcs format, like this:enter image description here
How can I adjust the table to fit into one page column?

Best Answer

Replace first row of your table with:

\begin{tabularx}{\columnwidth}{@{}c L S[table-format=7.0]*{2}{S[table-format=2.0]}@{}}

Result will be something like this:

enter image description here

Edit: Slightly better result you will obtain with:

\begin{table}[htb]
\centering
\setlength{\tabcolsep}{2pt}
\small
\begin{tabularx}{\columnwidth}{@{}c L S[table-format=7.0]*{2}{S[table-format=2.0]}@{}}
    \toprule
    \thead{ID}  &   \thead{UCI Dataset Name}
    &   {\thead{Samples\\(num.)}}
    &   {\thead{Attributes\\(num.)}}
    &   {\thead{Classes\\(num.)}}           \\
    \midrule
    DS1 & Poker Hand                          & 1025010  & 11    & 9     \\
    DS2 & SUSY                                & 5000000  & 18    & 2     \\
    DS3 & Record Linkage Comparison  Patterns & 5749132  & 9     & 2     \\
    DS4 & KDD Cup 1999                        & 4898431  & 42    & 23    \\
    \bottomrule
\end{tabularx}
\caption{Datasets used for empirical evaluation}
\label{table:1}
\end{table}

enter image description here

Related Question