How to reduce space between two columns under a multicolumn header [duplicate]

I want to make the number and percentage in the last column well aligned to the right in every row. Separating them into two columns is the solution that worked for me because the number and percentage length is not fixed.

I have a very large other table (this is only a small sample) so please try to solve my problem with the way I use (multi columns to separate the number and percentage) without coming with completely new solutions as this way is used in many large tables.

The problem: in my method to achieve the right alignment I want, the space between the number and its percentage is large.

I want to reduce this space (see the red rectangle in the figure below).

The script in ACM conference template (2 columns template):

\documentclass[sigconf]{acmart}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{array, makecell}
\usepackage[font={small}]{caption}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{paralist}
\usepackage{mathptmx}
\usepackage[compact]{titlesec}
\usepackage{sistyle}
\SIthousandsep{,}
\pagestyle{plain}

\begin{document}

\title{Title}

\begin{abstract}
Abstract
\end{abstract}

\maketitle
\section{Sample}

\begin{table}[!tp]
\centering
\caption{Results}
\label{tab:results}
\begin{tabular}{llllrr}
\toprule
\midrule
\multirow{4}{*}{\texttt{program 1}}&
\multirow{2}{*}{\texttt{dataset 1}} & \multirow{2}{*}{\num{\#\#\#\#\#\#}}
& type 1 & \num{\#\#\#\#\#}&(\#\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#\#} & (\#\#.\#\#\%)\\
\cline{2-6}

& \multirow{2}{*}{\texttt{dataset 2}} & \multirow{2}{*}{\num{\#\#\#\#}}
& type 1 & \num{\#\#\#\#}&(\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#}& (\#\#\.\#\%) \\

\midrule
\multirow{4}{*}{\texttt{program 2}}&
\multirow{2}{*}{\texttt{dataset 1}} & \multirow{2}{*}{\num{\#\#\#}}
& type 1 & \num{\#\#\#}& (\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#}& (\#.\#\%)\\
\cline{2-6}

& \multirow{2}{*}{\texttt{dataset 2}} & \multirow{2}{*}{\num{\#\#\#}}
&type 1 & \num{\#\#} & (\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#\#} & (\#\#\.\#\%) \\
\bottomrule
\end{tabular}
\end{table}

\end{document}


EDIT:

Please note, I just want to reduce the spaces between columns in the last column (which is a multicolumn) (Col 5 in the provided figure).

marked as duplicate by Raaja, Stefan Pinnow, barbara beeton, JouleV, user36296Mar 26 at 17:22

You can simply add @{} between columns in the table declaration to reduce the space between them to 0. Alternatively you can specify a certain non-zero distance with @{\hspace{2pt}} (you can put whatever you wish instead of 2pt: 1cm, 5em,...).

So in your example: \begin{tabular}{llllr@{\hspace{2pt}}r}

\documentclass[sigconf]{acmart}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{array, makecell}
\usepackage[font={small}]{caption}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{paralist}
\usepackage{mathptmx}
\usepackage[compact]{titlesec}
\usepackage{sistyle}
\SIthousandsep{,}
\pagestyle{plain}

\begin{document}

\title{Title}

\begin{abstract}
Abstract
\end{abstract}

\maketitle
\section{Sample}

\begin{table}[!tp]
\centering
\caption{Results}
\label{tab:results}
\begin{tabular}{llllr@{\hspace{2pt}}r}
\toprule
\midrule
\multirow{4}{*}{\texttt{program 1}}&
\multirow{2}{*}{\texttt{dataset 1}} & \multirow{2}{*}{\num{\#\#\#\#\#\#}}
& type 1 & \num{\#\#\#\#\#}&(\#\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#\#} & (\#\#.\#\#\%)\\
\cline{2-6}

& \multirow{2}{*}{\texttt{dataset 2}} & \multirow{2}{*}{\num{\#\#\#\#}}
& type 1 & \num{\#\#\#\#}&(\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#}& (\#\#\.\#\%) \\

\midrule
\multirow{4}{*}{\texttt{program 2}}&
\multirow{2}{*}{\texttt{dataset 1}} & \multirow{2}{*}{\num{\#\#\#}}
& type 1 & \num{\#\#\#}& (\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#}& (\#.\#\%)\\
\cline{2-6}

& \multirow{2}{*}{\texttt{dataset 2}} & \multirow{2}{*}{\num{\#\#\#}}
&type 1 & \num{\#\#} & (\#.\#\%)\\
\cline{4-6}
& & & type 2  & \num{\#\#\#\#} & (\#\#\.\#\%) \\
\bottomrule
\end{tabular}