删除延伸的列线并设置行高

删除延伸的列线并设置行高

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\usepackage{booktabs}
\usepackage{nicefrac}
\usepackage{array}
\usepackage{multirow}
\begin{document}
\begin{table*}[t]
    \caption{Improvement in Reliability}
    \label{table_example}
    \centering

    \begin{tabular}{|p{1.5em}|p{2.1em}|p{1.5 em}|p{3.3em}|p{3.3em}|p{3.3em}|p{3.3em}|p{4.25em}|p{3.3em}|p{3.3em}|p{3.3em}|p{3.3em}|p{4.25em}|}
        \hline

    \multirow{2}{1.5em}{Tasks} &
    \multirow{2}{0.30em}{Edges} &
    \multicolumn{6}{|c|}{Reliability}
    & \multicolumn{5}{|c|}{\%Improvement}   

    \\
    \cline{3-13}

    & & Ref. [12] & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint \\[-7pt]
    \hline

    s00 &   7 & 0.923   &   0.957 & 0.958  &    0.958 & 0.984 & 0.9849 &    3.673 & 3.770&  3.770  &    6.706 & 6.706\\[-7.25pt]
    \hline

    s01 & 68 & 0.431 &  0.503 & 0.541 & 0.591 & 0.675 & 0.798 & 16.787 & 25.702 &   37.288 &    56.652 &    85.280\\[-7.25pt]

    \hline      


    s02 &   81 &    0.339 &     0.396 & 0.429 & 0.444 & 0.554 & 0.754 & 16.987 &    26.609 &    31.049 &    63.604 &    122.747 \\[-7.25pt] 


    \hline\end{tabular}
\end{table*}
\end{document}

答案1

每条线之间都有负间距(这就是垂直线过度的原因)如果您删除选项,[]\\会按预期工作。这显示了您的原始图像和没有负空间的效果。

在此处输入图片描述

答案2

您的代码不会产生帖子标题中提到的和屏幕截图中显示的“扩展列线”。我确实注意到\multicolumn“可靠性”和“改进百分比”的 s 开头的垂直线增加了一倍;最好将它们删除。您的代码中还有一些负面的行距调整指令,这些指令未显示在屏幕截图中;我会删除它们。

您使用table*环境来跨越两列,但您却放弃了相当多的可用水平空间。因此,表格看起来不必要地拥挤。我将使用一个tabularx宽度设置为 的环境\linewidth,并使用(修改后的)X列类型作为第 3 至第 13 列。这样,LaTeX 将为您处理列宽计算。最后,我将利用包的宏booktabs(您已经加载)并删除所有垂直线以“打开”表格的外观。这些更改的结果显示在第二个表中。

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{tabularx}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
\begin{document}
\begin{table*}[t]
\caption{Improvement in Reliability}
\label{table_example}
\centering
\begin{tabular}{|p{1.5em}|p{2.1em}|p{1.5em}|p{3.3em}|p{3.3em}|p{3.3em}|p{3.3em}|p{4.25em}|p{3.3em}|p{3.3em}|p{3.3em}|p{3.3em}|p{4.25em}|}
\hline
\multirow{2}{1.5em}{Tasks} &
\multirow{2}{0.30em}{Edges} &
\multicolumn{6}{c|}{Reliability} & 
\multicolumn{5}{c|}{\%Improvement}   
\\
\cline{3-13}
& & Ref. [12] & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint \\%[-7pt]
\hline
s00 &   7 & 0.923   &   0.957 & 0.958  &0.958 & 0.984 & 0.9849 &3.673 & 3.770&  3.770  &6.706 & 6.706\\%[-7.25pt]
\hline
s01 & 68 & 0.431 &  0.503 & 0.541 & 0.591 & 0.675 & 0.798 & 16.787 & 25.702 &   37.288 &56.652 &85.280\\%[-7.25pt]
\hline  
s02 &   81 &0.339 & 0.396 & 0.429 & 0.444 & 0.554 & 0.754 & 16.987 &26.609 &31.049 &63.604 &122.747 \\%[-7.25pt] 
\hline
\end{tabular}

\bigskip\bigskip
\caption{Improvement in Reliability, Take 2}
\label{table_example_2}
\begin{tabularx}{\linewidth}{@{} p{1.5em}p{2.1em} *{11}{Y} @{}}
\toprule
Tasks & Edges &
\multicolumn{6}{c}{Reliability} & 
\multicolumn{5}{c}{\% Improvement}   
\\
\cmidrule(lr){3-8} \cmidrule(l){9-13}
& & Ref.\ [12] & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint & Same Latency & Latency 5\% & Latency 10\% & Latency 25\% & No Constraint \\%[-7pt]
\midrule
s00 &   7 & 0.923   &   0.957 & 0.958  &0.958 & 0.984 & 0.9849 &3.673 & 3.770&  3.770  &6.706 & 6.706\\%[-7.25pt]

s01 & 68 & 0.431 &  0.503 & 0.541 & 0.591 & 0.675 & 0.798 & 16.787 & 25.702 &   37.288 &56.652 &85.280\\%[-7.25pt]

s02 &   81 &0.339 & 0.396 & 0.429 & 0.444 & 0.554 & 0.754 & 16.987 &26.609 &31.049 &63.604 &122.747 \\%[-7.25pt] 
\bottomrule
\end{tabularx}
\end{table*}
\end{document}

相关内容