여기에서 꽤 많은 게시물을 검토했지만 모든 것이 제 테이블을 깨뜨리는 것 같아서 문제를 게시하고 도움을 요청해야겠다고 생각했습니다. 나는 다음을 사용하여 테이블을 생성했습니다.https://www.tablesgenerator.com
텍스트를 축소하지 않고 테이블을 페이지 너비에 맞추는 데 문제가 있습니다.
\documentclass[acmsmall]{acmart}
\usepackage{graphicx}
\usepackage[table,xcdraw]{xcolor}
\begin{table}[]
\resizebox{\textwidth}{!}{%
\begin{tabular}{lcccccccccccc}
\hline
\rowcolor[HTML]{EFEFEF}
\multicolumn{13}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title}} \\ \hline
\textit{\textbf{Hashtag}} & \multicolumn{3}{c}
{\textit{\textbf{Service1}}} & \multicolumn{3}{c}
{\textit{\textbf{Service2}}} & \multicolumn{3}{c}
{\textit{\textbf{Service3}}} & \multicolumn{3}{c}
{\textit{\textbf{Service4}}} \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{} & \textit{True} & \textit{False} & \textit{Accuracy} &
\textit{True} & \textit{False} & \textit{Accuracy} & \textit{True} &
\textit{False} & \textit{Accuracy} & \textit{True} & \textit{False} &
\textit{Accuracy} \\ \hline
\textit{\#1} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#2} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\textit{\#3} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#4} & n & n & n\% & x & x & x & n& 100 & n\% & n
& n & n\% \\ \hline
\begin{tabular}[c]{@{}l@{}}\#5, \\ \#6, \\ \#7\end{tabular} & n & n &
n\% & n & n & n\% & n & n & n\% & n & n & n\% \\ \hline
\end{tabular}%
}
\end{table}
답변1
\tabcolsep
더 작 거나 축약된 열 헤더를 사용하는 두 가지 가능한 솔루션은 다음과 같습니다 .
\documentclass[acmsmall]{acmart}
\usepackage{graphicx}
\usepackage{colortbl}
\begin{document}
\begin{table}
\setlength{\tabcolsep}{4pt}
\begin{tabular}{lcccccccccccc}
\hline
\rowcolor[HTML]{EFEFEF}
\multicolumn{13}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title}} \\ \hline
\textit{\textbf{Hashtag}} & \multicolumn{3}{c}
{\textit{\textbf{Service1}}} & \multicolumn{3}{c}
{\textit{\textbf{Service2}}} & \multicolumn{3}{c}
{\textit{\textbf{Service3}}} & \multicolumn{3}{c}
{\textit{\textbf{Service4}}} \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{} & \textit{True} & \textit{False} & \textit{Acc.} &
\textit{True} & \textit{False} & \textit{Acc.} & \textit{True} &
\textit{False} & \textit{Accuracy} & \textit{True} & \textit{False} &
\textit{Acc.} \\ \hline
\textit{\#1} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#2} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\textit{\#3} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#4} & n & n & n\% & x & x & x & n& 100 & n\% & n
& n & n\% \\ \hline
\#5 &&&&&&&&&&&&\\
\#6, & n & n &
n\% & n & n & n\% & n & n & n\% & n & n & n\% \\
\#7 &&&&&&&&&&&&\\
\hline
\end{tabular}
\end{table}
\begin{table}
\begin{tabular}{lcccccccccccc}
\hline
\rowcolor[HTML]{EFEFEF}
\multicolumn{13}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title}} \\ \hline
\textit{\textbf{Hashtag}} & \multicolumn{3}{c}
{\textit{\textbf{Service1}}} & \multicolumn{3}{c}
{\textit{\textbf{Service2}}} & \multicolumn{3}{c}
{\textit{\textbf{Service3}}} & \multicolumn{3}{c}
{\textit{\textbf{Service4}}} \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{} & \textit{T} & \textit{F} & \textit{Acc.} &
\textit{T} & \textit{F} & \textit{Acc.} & \textit{T} &
\textit{F} & \textit{Acc.} & \textit{T} & \textit{F} &
\textit{Acc.} \\ \hline
\textit{\#1} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#2} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\textit{\#3} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#4} & n & n & n\% & x & x & x & n& 100 & n\% & n
& n & n\% \\ \hline
\begin{tabular}[c]{@{}l@{}}\#5, \\ \#6, \\ \#7\end{tabular} & n & n &
n\% & n & n & n\% & n & n & n\% & n & n & n\% \\ \hline
\multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
\end{tabular}%
\end{table}
\end{document}
답변2
표에는 일반 크기의 사용 가능한 텍스트 너비에 맞추기에는 열이 너무 많습니다. 그러나 사용하는 대신 \resizebox
더 작은 글꼴 크기를 수동으로 선택할 수 있습니다. 예를 들어 \small
이렇게 하면 글꼴 크기에 더 적합한 문자 모양이 제공됩니다.
또한 헤더의 긴 단어 중 일부를 축약하여 공간을 확보할 수 있습니다.
\PassOptionsToPackage{table,xcdraw}{xcolor}
\PassOptionsToPackage{showframe}{geometry}
\documentclass[acmsmall]{acmart}
\usepackage{graphicx}
% \usepackage[table,xcdraw]{xcolor}
\begin{document}
\begin{table}[]
% \resizebox{\textwidth}{!}{%
\small
\begin{tabular}{lcccccccccccc}
\hline
\rowcolor[HTML]{EFEFEF}
\multicolumn{13}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title}} \\ \hline
\textit{\textbf{Hashtag}} & \multicolumn{3}{c}
{\textit{\textbf{Service1}}} & \multicolumn{3}{c}
{\textit{\textbf{Service2}}} & \multicolumn{3}{c}
{\textit{\textbf{Service3}}} & \multicolumn{3}{c}
{\textit{\textbf{Service4}}} \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{} & \textit{True} & \textit{False} & \textit{Acc.} &
\textit{True} & \textit{False} & \textit{Acc.} & \textit{True} &
\textit{False} & \textit{Accuracy} & \textit{True} & \textit{False} &
\textit{Acc.} \\ \hline
\textit{\#1} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#2} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\textit{\#3} & n & n & n\% & x & x & x & n & n & n\% & n &
n & n\% \\ \hline
\rowcolor[HTML]{EFEFEF}
\textit{\#4} & n & n & n\% & x & x & x & n& 100 & n\% & n
& n & n\% \\ \hline
\#5 &&&&&&&&&&&&\\
\#6, & n & n &
n\% & n & n & n\% & n & n & n\% & n & n & n\% \\
\#7 &&&&&&&&&&&&\\
\hline
\end{tabular}%
% }
\end{table}
\end{document}