如何修复LaTeX表格中单元格竖线断开的问题
修复LaTeX表格竖线断开问题
问题根源
你的代码有两个核心问题导致竖线断开:
- 每行末尾多了一个多余的
&符号,表格定义为4列,但每行实际写了5个单元格标记(4个&分隔出5列),列数不匹配直接引发竖线错位 - 嵌套的
flushright+centering环境冗余且干扰单元格布局,过度的vspace压缩也会破坏单元格高度对齐
修正后的完整代码
\\begin{table*}[!htb] \\caption{} \\label{tab:Apps} \\begin{center} %\\small\\setlength\\tabcolsep{6pt} \\begin{tabular}{|p{0.13\\textwidth}|p{0.43\\textwidth}|p{0.15\\textwidth}|p{0.18\\textwidth}|} \\hline \\centering\\textbf{Text} & \\centering\\textbf{Text} & \\centering\\textbf{Text} & \\textbf{Text}\\\\ \\hline \\centering Text \\vspace*{-3pt} & \\vspace{-2pt}\\begin{itemize}[leftmargin=*, noitemsep, topsep=0pt] \\item Text. \\end{itemize} & \\centering Text \\vspace*{-3pt} & \\centering Text \\vspace*{-3pt} \\\\ \\hline \\centering Text \\vspace*{-3pt} & \\vspace{-2pt}\\begin{itemize}[leftmargin=*, noitemsep, topsep=0pt] \\item Text. \\end{itemize} & \\centering Text \\vspace*{-3pt} & \\centering Text \\vspace*{-3pt} \\\\ \\hline \\end{tabular} \\end{center} \\end{table*}
关键修改说明
- 删除每行末尾多余的
&,确保列数与tabular定义的4列完全一致 - 移除冗余的
flushright环境,直接用\\centering实现单元格内容居中 - 去掉列表里过度压缩的
\\vspace*{-1.7\\baselineskip},避免单元格高度异常导致竖线断裂
内容的提问来源于stack exchange,提问作者George
相关产品推荐
相关产品推荐

