単語が混ざってしまった表を修正する方法

単語が混ざってしまった表を修正する方法

約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

問題は、「Features」が長い列エントリであり、X列タイプ (定義しているものC) によってすべての列の幅が同じになることです。c列に切り替えると、列はコンテンツに対して十分な幅になりますが、テーブルは (おそらく) テキスト領域に対して幅が広すぎます。「テキストをどのように収めるべきか?」は、TeX でその「方法」を実装する前に答える必要がある質問です。

1 つのオプションは、Feature 列のラベルを回転することです。これは通常、好ましく思われないので、必要な場合は調べてください。2 番目のオプションは、Feature 列のラベルを 1 行おきにずらすことです。3 番目のオプション (私の好み) は、「Features」と「Labels」の部分を別のテーブルに分けることです。

オプション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}

関連情報