Latex 多列问题
我正在尝试在乳胶中构建一个表格,其中五列有一个位于列上方居中的公共标题。 但生成的表并没有按预期出现。 (通用标题左对齐,而不是在列上方居中)
代码看起来像
\documentclass{article}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|l|c|c|c|r|}
\multicolumn{5}{c}{Hydrotalcite} \\
\hline
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003 \\
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003 \\
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003
\end{tabular}
\caption{lala}
\label{tabTableRefereaSDasdnce}
\end{table}
\end{document}
我在 Windows XP 上运行 miktex 2.8
I am trying to build a table in latex where five columns have a common title centered above the columns.
But the generated table does not appear as expected. (the common title is left justified instead of centered above the columns)
The code looks like
\documentclass{article}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|l|c|c|c|r|}
\multicolumn{5}{c}{Hydrotalcite} \\
\hline
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003 \\
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003 \\
kalhsdfsa & 1 asdf asf asfa &7as dfas fasdf as0 & 003
\end{tabular}
\caption{lala}
\label{tabTableRefereaSDasdnce}
\end{table}
\end{document}
And I'm running miktex 2.8 on Windows XP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
过高
您的多列金额对
\multicolumn{4}{c}{Hydrotalcite} \\\hline
的更改(而不是
\multicolumn{5}{c}{Hydrotalcite} \ \\hline
)或实际添加第五列;-)
your multicolumn amount is one too high
change to
\multicolumn{4}{c}{Hydrotalcite} \\\hline
(in stead of
\multicolumn{5}{c}{Hydrotalcite} \\\hline
)or actually add the fifth column ;-)
您在表格环境中指定了五列,并指定
\multicolumn
应跨越五列,但表中的任何行都没有超过四个条目。添加第五列会使\multicolumn
正常工作。You specify five columns in your tabular environment, and you specify that the
\multicolumn
should span five columns, but no row of the table has more than four entries. Adding a fifth column causes the\multicolumn
to work properly.