我希望能够划分下表中的 bw 和 g 列,如下图所示

我希望能够划分下表中的 bw 和 g 列,如下图所示
\开始{表格}[htbp]
%\centering %% 冗余
\begin{tabularx}{\linewidth}{ |l| *{5}{C|} }
\hline
\textit{\textbf{参数}} &
\textit{\textbf{列车(WOE)}} &
\textit{\textbf{列车(WRE)}} &
\textit{\textbf{G}} &
\textit{\textbf{B}} &
\textit{\textbf{W}}
\\
\hline
0.05\_0.025\_0.05\_0.2 & 42.72 & 44.89 & 677 & 76 & 497 \\
\hline
0.05\_0.05\_0.05\_0.1 & 48.55 & 55.19 & 440 & 67 & 569\\
\hline
0.05\_0.075\_0.05\_0.2 & 36.92 & 43.87 & 695 & 84 & 497\\
\hline
0.1\_0.05\_0.2\_0.2 & 38.09 & 53.03 & 436 & 112 & 486\\
\hline
0.2\_0.05\_0.05\_0 & 36.21 & 55.91 & 336 & 83 & 469\\
\hline
0.2\_0.05\_0.1\_0.05 & 43.12 & 60.67 & 243 & 127 & 447\\
\hline
平均 &40.93 &52.26 &471 &87 &495 \\
\hline
\结束{tabularx}
\caption{比较没有信息交换和有随机方法信息交换的平均适应度值}
\label{tab:没有信息交换和有信息交换 WRT 随机方法的平均适应度值的比较}   
\茶几}

在此处输入图片描述

答案1

我猜想那些粗黑的规则是为了表明结盟

为此,您可以手动填充数字条目以包含三名数字,或者使用siunitx

在这种情况下,均衡最后五列并将剩余部分留在第一列并不困难。

\documentclass{IEEEtran}
\usepackage{tabularx}
\usepackage{siunitx}

\begin{document}

\begin{table}[htbp]
\caption{Comparison of Avg.\ fitness values without information exchange 
  and with  information exchange by random approach}
\label{tab:ComparisonAvgfitness}

\begin{tabularx}{\linewidth}{
 |X|
 S[table-format=2.2] |
 S[table-format=2.2] |
 S[table-format=3.0] |
 S[table-format=3.0] |
 S[table-format=3.0] |
}
\hline 
\itshape\bfseries Parameters & 
{\itshape\bfseries Train} &
{\itshape\bfseries Train} &
{\itshape\bfseries G} &
{\itshape\bfseries B} &
{\itshape\bfseries W} \\
& 
{\itshape\bfseries (WOE)} &
{\itshape\bfseries (WRE)} & 
{\hphantom{11.11}} &
{\hphantom{11.11}} &
{\hphantom{11.11}} \\
\hline
0.05\_0.025\_0.05\_0.2 & 42.72 & 44.89 & 677  & 76  & 497 \\ 
\hline
0.05\_0.05\_0.05\_0.1  & 48.55 & 55.19 & 440  & 67 & 569\\ 
\hline
0.05\_0.075\_0.05\_0.2 & 36.92 & 43.87 & 695 & 84 & 497\\ 
\hline
0.1\_0.05\_0.2\_0.2   & 38.09 & 53.03 & 436  & 112 & 486\\ 
\hline
0.2\_0.05\_0.05\_0     & 36.21 & 55.91 & 336 & 83 & 469\\ 
\hline
0.2\_0.05\_0.1\_0.05   & 43.12 & 60.67 & 243 & 127 & 447\\
\hline
Average & 40.93 & 52.26 & 471  & 87 & 495 \\
\hline
\end{tabularx}
\end{table}

\end{document}

在此处输入图片描述

请注意,IEEE 样式(从您所展示的内容中很容易猜到)要求表格标题位于表格上方。

您可能会觉得有趣的不同认识。

\documentclass{IEEEtran}
\usepackage{siunitx,booktabs}

\sisetup{detect-all}

\begin{document}

\begin{table}[htbp]
\caption{Comparison of Avg.\ fitness values without information exchange 
  and with  information exchange by random approach}
\label{tab:ComparisonAvgfitness}

\begin{tabular*}{\linewidth}{
 @{\extracolsep{\fill}}
 l
 S[table-format=2.2]
 S[table-format=2.2]
 S[table-format=3.0]
 S[table-format=3.0]
 S[table-format=3.0]
 @{}
}
\toprule
\itshape\bfseries Parameters & 
{\itshape\bfseries Train} &
{\itshape\bfseries Train} &
{\itshape\bfseries G} &
{\itshape\bfseries B} &
{\itshape\bfseries W} \\
& 
{\itshape\bfseries (WOE)} &
{\itshape\bfseries (WRE)} \\
\midrule
0.05\_0.025\_0.05\_0.2 & 42.72 & 44.89 & 677  & 76  & 497 \\ 
0.05\_0.05\_0.05\_0.1  & 48.55 & 55.19 & 440  & 67 & 569\\ 
0.05\_0.075\_0.05\_0.2 & 36.92 & 43.87 & 695 & 84 & 497\\ 
0.1\_0.05\_0.2\_0.2   & 38.09 & 53.03 & 436  & 112 & 486\\ 
0.2\_0.05\_0.05\_0     & 36.21 & 55.91 & 336 & 83 & 469\\ 
0.2\_0.05\_0.1\_0.05   & 43.12 & 60.67 & 243 & 127 & 447\\
\midrule
Average & 40.93 & 52.26 & 471  & 87 & 495 \\
\bottomrule
\end{tabular*}
\end{table}

\end{document}

在此处输入图片描述

答案2

您没有提供任何有关新列宽度的信息,因此我猜您正在寻找类似这样的内容:

在此处输入图片描述

\documentclass{article}
\usepackage{geometry}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}


\begin{document}
    \begin{table}[htbp]
\begin{tabularx}{\linewidth}{ |l| *{2}{C|}*{3}{C|c|} }
    \hline
\multirow{2}{*}{\textit{\textbf{Parameters}}} 
    &   \textit{\textbf{Train}} 
        &   \textit{\textbf{Train}} 
            &   \multicolumn{2}{c|}{\textit{\textbf{G}}} 
                    &   \multicolumn{2}{c|}{\textit{\textbf{B}}}
                            &   \multicolumn{2}{c|}{\textit{\textbf{W}}}    \\
    \cline{4-9}
    &   \textit{\textbf{(WOE)}}
        &   \textit{\textbf{(WRE)}}
            &   &   &   &   &   &                                           \\
    \hline
0.05\_0.025\_0.05\_0.2 & 42.72 & 44.89 & 677 & & 76 & & 497 &               \\
    \hline
0.05\_0.05\_0.05\_0.1  & 48.55 & 55.19 & 440 & & 67 & & 569 &               \\
    \hline
\end{tabularx}
\caption{Comparison of Avg. fitness values without information exchange and with  information exchange by random approach}
\label{tab:Comparison of Avg. fitness values without information exchange and with  information exchange W.R.T random approach}
    \end{table}
\end{document}

或者

在此处输入图片描述

您只需更改列标题:

...
\multirow{2}{*}{\textit{\textbf{Parameters}}} 
    &   \multicolumn{2}{c|}{\textit{\textbf{Train}}}
            &   \multicolumn{2}{c|}{\textit{\textbf{G}}} 
                    &   \multicolumn{2}{c|}{\textit{\textbf{B}}}
                            &   \multicolumn{2}{c|}{\textit{\textbf{W}}}    \\
...

附录: 要使所有列(第一列除外)的宽度相等,您需要将这些列指定为C列类型。由于此表变得相当宽,您需要减小表中使用的字体大小并减小\tabcolsep。为了使表看起来更好,建议增加\arrraystreatch表:

在此处输入图片描述

\documentclass{article}
\usepackage{geometry}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \begin{table}[htbp]
    \small  % <---
    \setlength\tabcolsep{4pt}% <--- default is 6pt
    \renewcommand\arraystretch{1.2}% <---
\begin{tabularx}{\linewidth}{ |l| *{8}{C|}}
    \hline
\multirow{2}{*}{\textit{\textbf{Parameters}}}
    &   \textit{\textbf{Train}}
        &   \textit{\textbf{Train}}
            &   \multicolumn{2}{c|}{\textit{\textbf{G}}}
                    &   \multicolumn{2}{c|}{\textit{\textbf{B}}}
                            &   \multicolumn{2}{c|}{\textit{\textbf{W}}}    \\
    \cline{4-9}
    &   \textit{\textbf{(WOE)}}
        &   \textit{\textbf{(WRE)}}
            &   &   &   &   &   &                                           \\
    \hline
0.05\_0.025\_0.05\_0.2 & 42.72 & 44.89 & 677 & & 76 & & 497 &               \\
    \hline
0.05\_0.05\_0.05\_0.1  & 48.55 & 55.19 & 440 & & 67 & & 569 &               \\
    \hline
\end{tabularx}
\caption{Comparison of Avg. fitness values without information exchange and with  information exchange by random approach}
\label{tab:Comparison of Avg. fitness values without information exchange and with  information exchange W.R.T random approach}
    \end{table}
\end{document}

相关内容