简体   繁体   中英

Is it possible to use multicolumn and multirow Simultaneously in sigle cell?

I'm try to draw a table. but i faced with extra column line problem.

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabu}

\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tabu}{|c|c|c|c|c|c|c|}
    \hline
    \multirow{2}{*}{A} & \multicolumn{2}{c|}{\multirow{2}{*}{B}}  & \multicolumn{4}{c|}{C} \\
    \cline{4-7}
     & &  & E & F & G & H \\
    \cline{1-7} 
    \multirow{3}{*}{D} &
    \multirow{3}{*}{K}  & $1.0612e-09$ & $1.0610e-09$ &  $5.2760e-10$ &  $3.7844e-08$ & $7.6545e-06 $\\
    \cline{3-7} 
    &  & $9.724e-10$ & $9.7239e-10$ &  $4.8758e-10$ &  $4.9127e-08$ & $7.7153e-06 $\\
    \cline{3-7} 
    & & $9.132e-10$ & $9.131e-10$ &  $4.1633e-10$ &  $4.3932e-08$ & $8.2672e-06$\\[-1pt]
    %\cline{2-7
    \hline
\end{tabu}
\end{table*}

Does anyone know how to remove this extra line that shown in

这个

Don't use the tabu package - it is more or less completely broken. The only thing which holds this package together is a lot of ducktape by the latex team.

Instead you could use tabularray package, which makes merging cells much easier and you'll also don't have to worry how long all your lines should be.

You might also want to choose another column type, like S from siunitx, to avoid the incorrect spacing around your minus signs....

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabularray}

\UseTblrLibrary{siunitx}

\begin{document}

\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tblr}{
colspec={|c|c|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|},
vlines,
hlines,
row{1-2} = {guard}
}
    \SetCell[r=2]{} A & \SetCell[c=2,r=2]{} B && \SetCell[c=4]{} C &&& \\
     & &  & E & F & G & H \\
    \SetCell[r=3]{} D &
    \SetCell[r=3]{} K  & 1.0612e-09 & 1.0610e-09 & 5.2760e-10 &  3.7844e-08 & 7.6545e-06\\
    &  & 9.724e-10 & 9.7239e-10 & 4.8758e-10 & 4.9127e-08 & 7.7153e-06\\
    & & 9.132e-10 & 9.131e-10 & 4.1633e-10 & 4.3932e-08 & 8.2672e-06\\
\end{tblr}
\end{table*}


\end{document}

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM