有人知道如何修复右侧的垂直条吗?提前谢谢!
\begin{tabular}{ |p{0.15\linewidth}||p{0.15\linewidth}|p{0.15\linewidth}|p{0.2\linewidth}| p{0.2\linewidth}| }
\hline
\multicolumn{5}{|c|}{Project Timeline} \\
\hline
Family & First Examples Computed By&All Examples Computed By&Conjectures Proposed By & Proof Completed By\\
\hline
$I$ is funny & June 2021 &October 2021& December 2022 & May 2022 (if possible)\\
\hline\\
blah blah blah or $5$ & September 2021 &November 2021& January 2021 & May 2022 (if possible)\\
\hline\\
$I$ is angry & October 2021 &December 2021& February 2022 & May 2022 (if possible)\\
\hline
\end{tabular}
答案1
正如我在评论中所说,您不应该使用,\hline\\
而只能使用\hline
。
关于您的表格,有一些题外话。您没有提供任何有关文档布局的信息,也没有提供此表格如何插入其中。无论如何,看看以下对您的表格的重写是否对您有所帮助:
\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{ragged2e}
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash%
\hspace{0pt}\hsize=#1\hsize}X}
\begin{document}
\begin{table}[ht]
\setlength\extrarowheight{2pt}
\begin{tabularx}{\linewidth}{|L{0.85}||L{0.85}|L{0.85}|L{1.225}|L{1.225}|} \hline
\multicolumn{5}{|c|}{Project Timeline} \\
\hline
Family & First Examples Computed By & All Examples Computed By & Conjectures Proposed By & Proof Completed By\\
\hline
$I$ is funny & June 2021 &October 2021& December 2022 & May 2022 (if possible)\\
\hline
blah blah blah or $5$ & September 2021 &November 2021& January 2021 & May 2022 (if possible)\\
\hline
$I$ is angry & October 2021 &December 2021& February 2022 & May 2022 (if possible)\\
\hline
\end{tabularx}
\end{table}
\end{document}
现在表格宽度等于\textwidth
与其大小无关的宽度(您的宽度不是),单元格中的文本不是对齐的,而是(通过使用包智能地ragged2e
)通过新定义的列类型左对齐(这可以简单地改变单元格宽度之间的比率,但是,它们的总和必须是等于列数的整数)。