LaTeX 表格太宽。怎样才能让它合适呢?
我刚刚开始学习乳胶,现在我正在尝试创建一张桌子。这是我的代码:
\begin{table}
\caption{Top Scorers}
\begin{tabular}{ l l }
\hline
\bf Goals & \bf Players\\
\hline
4 & First Last, First Last, First Last, First Last\\
3 & First Last\\
2 & First Last\\
1 & First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last\\
\hline
\end{tabular}
\end{table}
问题是表格比页面宽。我希望它能像普通文本一样自动适应页面,但事实并非如此。我如何告诉乳胶使表格适合页面?
I just started to learn latex and now I'm trying to create a table. This is my code:
\begin{table}
\caption{Top Scorers}
\begin{tabular}{ l l }
\hline
\bf Goals & \bf Players\\
\hline
4 & First Last, First Last, First Last, First Last\\
3 & First Last\\
2 & First Last\\
1 & First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last\\
\hline
\end{tabular}
\end{table}
The problem is that the table is wider than the page. I was hoping that it would automatically fit to the page like normal text does, but it didn't. How do I tell latex to make the table fit to the page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
p{width}
列说明符:例如\begin{tabular}{ lp{10cm} }
会将列的内容放入10cm宽的parbox中,并且文本将正确像正常段落一样分成几行。您还可以使用
tabular*
环境来指定整个表格的宽度。Use
p{width}
column specifier: e.g.\begin{tabular}{ l p{10cm} }
will put column's content into 10cm-wide parbox, and the text will be properly broken to several lines, like in normal paragraph.You can also use
tabular*
environment to specify width for the entire table.您必须在调整大小框下获取整列。这段代码对我有用
You have to take whole columns under resizebox. This code worked for me
您也可以使用这些选项,使用
\footnotesize
或\tiny
。这对于安装大桌子确实有帮助。You can use these options as well, either use
\footnotesize
or\tiny
. This would really help in fitting big tables.