단어가 섞인 테이블을 수정하는 방법

단어가 섞인 테이블을 수정하는 방법

약 10개의 열이 있고 열 머리글이 교차하는 이 테이블이 있습니다.

테이블 디자인을 변경하지 않고 어떻게 열을 분리할 수 있나요? (이 디자인에 있어야 합니다.)

여기 스크립트가 있습니다

\documentclass[computers,article,submit,moreauthors,pdftex]{Definitions/mdpi} 

% MDPI internal commands - do not modify
\firstpage{1} 
\makeatletter 
\setcounter{page}{\@firstpage} 
\makeatother
\pubvolume{1}
\issuenum{1}
\articlenumber{0}
\pubyear{2023}
\copyrightyear{2023}
\datereceived{ } 
\daterevised{ } % Comment out if no revised date
\dateaccepted{ } 
\datepublished{ } 
\hreflink{https://doi.org/} % If needed use \linebreak

\Title{Test}

\begin{document}
\section{Background}
This the table \ref{table_FinalDataset}


\begin{table}[H] 
\caption{xxxxxxxxxxxxxxxxxxxxx.}
\label{table_FinalDataset}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\textwidth}{CCCCCCCCCCC}
\toprule
\multirow{2}{*}{\textbf{Report ID}}
& \multicolumn{5}{c}{\textbf{Features}}
& \multicolumn{5}{c}{\textbf{Labels}} \\ 
\cline{2-11}
& \textbf{C0004482} & \textbf{C0224473} & \textbf{C0719349}
& \textbf{C0230431} & \textbf{C0420607} & \textbf{295}
& \textbf{300}  & \textbf{303}  & \textbf{540}
& \textbf{560}\\
\midrule
            1012    &6  &0  &0  &4  &2  &0  &1  &1  &0  &0\\            
            1013    &0  &2  &2  &8  &0  &1  &1  &0  &0  &1  \\          
            1014    &0  &0  &4  &4  &9  &1  &0  &1  &0  &0  \\ 
            
\bottomrule
\end{tabularx}
\end{table}
\end{document}

답변1

문제는 "기능"이 긴 열 항목이고 X열 유형(사용자가 정의한 것 C)이 모든 열을 동일한 너비로 만든다는 것입니다. 열로 전환하면 c내용에 비해 너비가 충분히 넓어지지만 테이블은 텍스트 영역에 비해 너무 넓을 가능성이 높습니다. "텍스트를 어떻게 맞춰야 하나요?" "어떻게"를 구현하기 위해 TeX로 전환하기 전에 대답해야 하는 질문입니다.

한 가지 옵션은 기능 열 레이블을 회전하는 것입니다. 그건 보통 호의적으로 보지 않으니까, 원하시면 찾아보도록 할게요. 두 번째 옵션은 특성 열 레이블을 대체 행에 엇갈리게 배치하는 것입니다. 세 번째 옵션(제가 선호하는 것)은 "기능"과 "레이블" 부분을 별도의 테이블로 분리하는 것입니다.

옵션 2:
옵션 2 출력

옵션 3:
옵션 3 출력

\documentclass{article}

\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\section{Background}
This the table \ref{table_FinalDataset}

% option 2
\begin{table}
\caption{xxxxxxxxxxxxxxxxxxxxx.}
\label{table_FinalDataset}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\textwidth}{cCCCCCccccc}
\toprule
\textbf{Report}
& \multicolumn{5}{c}{\textbf{Features}}
& \multicolumn{5}{c}{\textbf{Labels}} \\ 
\cmidrule(lr){2-6}\cmidrule(l){7-11}
\textbf{ID} &  & \makebox[0pt]{\textbf{C0224473}} & 
& \makebox[0pt]{\textbf{C0230431}} &  & \textbf{295}
& \textbf{300}  & \textbf{303}  & \textbf{540}
& \textbf{560}\\
& \makebox[0pt]{\textbf{C0004482}} & & \makebox[0pt]{\textbf{C0719349}} && \makebox[0pt]{\textbf{C0420607}} \\
\midrule
            1012    &6  &0  &0  &4  &2  &0  &1  &1  &0  &0\\            
            1013    &0  &2  &2  &8  &0  &1  &1  &0  &0  &1  \\          
            1014    &0  &0  &4  &4  &9  &1  &0  &1  &0  &0  \\ 
            
\bottomrule
\end{tabularx}
\end{table}

\clearpage

% option 3a
\begin{table}[h]\small
\caption{Features by Report ID.}
\label{table_FinalDataset_features}
\begin{tabular*}{\textwidth}{cccccc}
\toprule
\textbf{Report ID}
& \textbf{C0004482} & \textbf{C0224473} & \textbf{C0719349}
& \textbf{C0230431} & \textbf{C0420607} \\
\midrule
            1012    &6  &0  &0  &4  &2\\            
            1013    &0  &2  &2  &8  &0\\          
            1014    &0  &0  &4  &4  &9\\ 
\bottomrule
\end{tabular*}
\end{table}

% option 3b
\begin{table}[h]\centering
\caption{Labels by Report ID.}
\label{table_FinalDataset_labels}
\begin{tabular}{cccccc}
\toprule
\textbf{Report ID} & \textbf{295}
& \textbf{300}  & \textbf{303}  & \textbf{540}
& \textbf{560}\\
\midrule
            1012    &0  &1  &1  &0  &0\\            
            1013    &1  &1  &0  &0  &1  \\          
            1014    &1  &0  &1  &0  &0  \\ 
\bottomrule
\end{tabular}
\end{table}
\end{document}

관련 정보