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

LaTeX表格居中失效及‘Per cent split’行格式调整求助

LaTeX表格问题修复方案

一、解决表格不居中的问题

你之前用\begin{center}包裹table环境无效,是因为table属于浮动体,外部的居中命令无法控制它的位置。直接在table环境内部添加\centering命令,同时删掉外部的center环境即可:

\begin{table}[h]
\centering % 替换外部center环境,放在table内部生效
\caption{some caption.} 
\label{tab:1} % 去掉标签里的空格,避免编译潜在问题

二、调整“Per cent split”行的格式

当前该行仅写文本未跨列,导致格式错位。用\multicolumn命令让文本跨表格全部6列,同时保留左右两侧的竖线,保证和其他行格式一致:

\hline\hline
\multicolumn{6}{||c||}{Per cent split} % 跨6列、居中显示、保留两侧竖线
\hline\hline

完整修正代码

\begin{table}[h]
\centering
\caption{some caption.} 
\label{tab:1}
\begin{tabular}{||c | c c c c c||}
 \hline
Team & Goal & SOG & SA & Hits & Possession \\ 
 \hline\hline
 \textbf{Team1} & 54 & 171 & 464 & 941 & 11:46:33 \\
 \hline
 \textbf{Team2} & 89 & 237 & 502 & 861 & 10:28:02 \\
\hline\hline
\multicolumn{6}{||c||}{Per cent split} \\
\hline\hline
 \textbf{Team1} & 38\% & 42\% & 48\% & 52\% & 53\% \\
 \hline
\end{tabular}
\end{table}

额外优化说明:

  • 补全了每行末尾的\\,避免编译时出现格式警告
  • 清理了原代码中多余的空格,让代码更规整
  • 修正了标签里的空格,符合LaTeX的标签命名规范

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.06 09:25:44