合并 LaTeX 表格中的单元格
我有一个非常简单的表:
\begin{table}[t]
\begin{tabular}{|c||c|c|c|}
\hline
\multirow{2}{*}{Implementation} & Test 1 & Test2 & Test3 \\\hline
& \multicolumn{3}{|c|}{results} \\\hline\hline
\end{tabular}
\end{table}
它几乎“完美”,我遇到的唯一问题是 hline 仍然穿过我合并的前两个单元格。 基本上,它看起来像这样
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" ----Implementation-------------------------------"
"| | results |"
"-------------------------------------------------"
但是,它应该像这样:
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" Implementation ---------------------------"
"| | results |"
"-------------------------------------------------"
有人知道如何摆脱第一列中的行吗?
谢谢
I have a very simple table:
\begin{table}[t]
\begin{tabular}{|c||c|c|c|}
\hline
\multirow{2}{*}{Implementation} & Test 1 & Test2 & Test3 \\\hline
& \multicolumn{3}{|c|}{results} \\\hline\hline
\end{tabular}
\end{table}
It works almost "perfect", the only problem that I have is that
the hline still goes through the first two cells that I have merged.
Basically, it looks like this
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" ----Implementation-------------------------------"
"| | results |"
"-------------------------------------------------"
However, it should like this:
"-------------------------------------------------"
"| | Test 1 | Test 2 | Test 3 |"
" Implementation ---------------------------"
"| | results |"
"-------------------------------------------------"
Anyone an idea how to get rid of the line in the first column?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要的命令是 \cline{ij},它可以让您仅在某些列上绘制行分隔线。请参阅http://www.giss.nasa.gov/tools/latex/ ltx-214.html 了解详细信息。
特别是,您需要使用 \cline{2-4} 在您提到的列上绘制一条水平线。这是您的代码,经过一处更改:
The command you want is \cline{i-j} which lets you draw a row divider across only certain columns. See http://www.giss.nasa.gov/tools/latex/ltx-214.html for details.
In particular, you'll want to use \cline{2-4} to draw a horizontal line across just the columns you mentioned. Here's your code with the one change:
好吧,为了不解决您的问题,我要指出的是,许多权威人士建议最大限度地减少表格中的内部墨水量(即放弃普通行之间的
\hline
) ,并使用此处最后一个数字行。如果您不受某些严格定义的样式指南的限制,这将是我的解决方案。
Well, to not address your question, I'll note that many authorities suggest minimizing the amount of internal ink in your table (i.e. ditch the
\hline
s between ordinary rows), and using something line the last figure here.If you are not constrained by some tightly defined style guide, this would be my solution.