1

I want to stop this table from overflowing to the right without using resizebox.

\documentclass[xcolor=table,sigconf,review,anonymous]{acmart}
\usepackage{booktabs, makecell, multirow, tabularx}
\usepackage{siunitx}

\begin{document}

\title{test}
\maketitle

\begin{table}[!htb]
   \caption{Number of requirements with seeded errors for which predictions could/could not be computed.}
\label{tab:dataPoints}
\begin{tabular}{|r|r|r|r|r|r|r|r|r|r|r|}
\hline
\multicolumn{1}{|c|}{\multirow{3}{*}{}} & \multicolumn{5}{c|}{T->N} & \multicolumn{5}{c|}{N->T} \\ \cline{2-11} 
\multicolumn{1}{|c|}{} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} \\ \cline{2-5} \cline{7-10}
\multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} \\ \hline
]0-20[ & 71 & 1 & 72 & 0 & 72 & 132 & 17 & 149 & 0 & 149 \\ \hline
[20-40[ & 129 & 51 & 180 & 0 & 180 & 167 & 18 & 185 & 0 & 185 \\ \hline
[40-60[ & 121 & 67 & 188 & 0 & 188 & 157 & 16 & 173 & 0 & 173 \\ \hline
[60-80[ & 87 & 71 & 158 & 0 & 158 & 156 & 13 & 169 & 0 & 169 \\ \hline
[80-100] & 36 & 146 & 182 & 0 & 182 & 161 & 13 & 148 & 26 & 174 \\ \hline
\end{tabular}
\end{table}

\end{document}
2
  • \setlength{\tabcolsep}{4pt}. – Ulrike Fischer May 4 '20 at 12:56
  • where should this be put? – user3406764 May 4 '20 at 12:58
1

Three versions using different values of \tabcolsep, different font sizes and different horizontal and vertical lines:

enter image description here

\documentclass[xcolor=table,sigconf,review,anonymous]{acmart}
\usepackage{booktabs, makecell, multirow, tabularx}
\usepackage{siunitx}

\begin{document}

\title{test}
\maketitle

\begin{table}[!htb]
   \caption{Number of requirements with seeded errors for which predictions could/could not be computed.}
   \setlength{\tabcolsep}{4.25pt}
\label{tab:dataPoints}
\begin{tabular}{|r|r|r|r|r|r|r|r|r|r|r|}
\hline
\multicolumn{1}{|c|}{\multirow{3}{*}{}} & \multicolumn{5}{c|}{T->N} & \multicolumn{5}{c|}{N->T} \\ \cline{2-11} 
\multicolumn{1}{|c|}{} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} \\ \cline{2-5} \cline{7-10}
\multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} \\ \hline
]0-20[ & 71 & 1 & 72 & 0 & 72 & 132 & 17 & 149 & 0 & 149 \\ \hline
[20-40[ & 129 & 51 & 180 & 0 & 180 & 167 & 18 & 185 & 0 & 185 \\ \hline
[40-60[ & 121 & 67 & 188 & 0 & 188 & 157 & 16 & 173 & 0 & 173 \\ \hline
[60-80[ & 87 & 71 & 158 & 0 & 158 & 156 & 13 & 169 & 0 & 169 \\ \hline
[80-100] & 36 & 146 & 182 & 0 & 182 & 161 & 13 & 148 & 26 & 174 \\ \hline
\end{tabular}
\end{table}


\begin{table}[!htb]
   \caption{Number of requirements with seeded errors for which predictions could/could not be computed.}
  \small
\label{tab:dataPoints}
\begin{tabular}{|r|r|r|r|r|r|r|r|r|r|r|}
\hline
\multicolumn{1}{|c|}{\multirow{3}{*}{}} & \multicolumn{5}{c|}{T->N} & \multicolumn{5}{c|}{N->T} \\ \cline{2-11} 
\multicolumn{1}{|c|}{} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} & \multicolumn{2}{c|}{T trace} & \multicolumn{2}{c|}{N trace} & \multicolumn{1}{c|}{\multirow{2}{*}{Tot.}} \\ \cline{2-5} \cline{7-10}
\multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{\checkmark} & \multicolumn{1}{c|}{x} & \multicolumn{1}{c|}{} \\ \hline
]0-20[ & 71 & 1 & 72 & 0 & 72 & 132 & 17 & 149 & 0 & 149 \\ \hline
[20-40[ & 129 & 51 & 180 & 0 & 180 & 167 & 18 & 185 & 0 & 185 \\ \hline
[40-60[ & 121 & 67 & 188 & 0 & 188 & 157 & 16 & 173 & 0 & 173 \\ \hline
[60-80[ & 87 & 71 & 158 & 0 & 158 & 156 & 13 & 169 & 0 & 169 \\ \hline
[80-100] & 36 & 146 & 182 & 0 & 182 & 161 & 13 & 148 & 26 & 174 \\ \hline
\end{tabular}
\end{table}


\begin{table}[!htb]
   \caption{Number of requirements with seeded errors for which predictions could/could not be computed.}
   \setlength{\tabcolsep}{4.5pt}
\label{tab:dataPoints}
\begin{tabular}{@{}rrrrrrrrrrr@{}}
\toprule
 & \multicolumn{5}{c}{T->N} & \multicolumn{5}{c}{N->T} \\ 
\cmidrule(r){2-6} \cmidrule(l){7-11} 
 & \multicolumn{2}{c}{T trace} & \multicolumn{2}{c}{N trace} & \multirow{2}{*}{Tot.} & \multicolumn{2}{c}{T trace} & \multicolumn{2}{c}{N trace} & \multicolumn{1}{c}{\multirow{2}{*}{Tot.}} \\ 
\cmidrule{2-5} \cmidrule{7-10}
 & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{x} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{x} &  & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{x} & \multicolumn{1}{c}{\checkmark} & \multicolumn{1}{c}{x}  \\ 
\midrule
]0-20[ & 71 & 1 & 72 & 0 & 72 & 132 & 17 & 149 & 0 & 149 \\{} 
[20-40[ & 129 & 51 & 180 & 0 & 180 & 167 & 18 & 185 & 0 & 185 \\{} 
[40-60[ & 121 & 67 & 188 & 0 & 188 & 157 & 16 & 173 & 0 & 173 \\{} 
[60-80[ & 87 & 71 & 158 & 0 & 158 & 156 & 13 & 169 & 0 & 169 \\ {}
[80-100] & 36 & 146 & 182 & 0 & 182 & 161 & 13 & 148 & 26 & 174 \\ 
\bottomrule
\end{tabular}
\end{table}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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