You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LaTeX多列表格代码优化求助:多余及缺失线条问题

修正LaTeX表格线条异常问题

原代码的线条问题源于\cline命令的列范围设置错误,表格仅6列却使用了超出范围的列号,且分割线范围不符合多列合并的结构。以下是修正后的代码:

\setlength{\extrarowheight}{1pt}
\begin{table*}[ht]
\caption{Compare with SAT-based approach}
\label{Results}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
    \hline
     Assay & Baseline & \multicolumn{2}{c|}{Our strategy} & \multicolumn{2}{c|}{SAT based Approach}\\
     \cline{2-2} \cline{3-4} \cline{5-6}
             & time-steps (T) & \#$CP$ & $CP/T * 100$ & \#$CP$ & $CP/T * 100$  \\
      \hline
      Text 1 & Text 3         & Text 5 & Text 7       & hjhb   & hjhbh   \\
      \hline
      Text 2 & Text 4 & Text 6 & Text 8 & hjhb & hjhbh \\ \hline
\end{tabular}
\end{table*}

修改说明:

  • 替换原错误的\cline{2-3} \cline{3-5} \cline{5-7}为\cline{2-2} \cline{3-4} \cline{5-6}:
    • \cline{2-2}:仅在Baseline列下方绘制分割线
    • \cline{3-4}:在Our strategy对应的两列下方绘制分割线
    • \cline{5-6}:在SAT based Approach对应的两列下方绘制分割线
  • 修正了原代码中&的转义问题,直接使用LaTeX原生的&符号

内容的提问来源于stack exchange,提问作者Souvik Gorai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 12:07:19