我们如何在 Overleaf 的 longtable 中包装文本? [英] How do we wrap text in a longtable in Overleaf?

查看:21
本文介绍了我们如何在 Overleaf 的 longtable 中包装文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Overleaf 上使用以下语法.但是,第一个标题正在溢出到第二列.我也尝试使用 p{0.75\linewidth} ,但是没有用.有什么建议吗?

\documentclass[12pt]{article}\begin{中心}\begin{table}[h!]\caption{表 17}\begin{tabular}{|m{5cm}|m{1.25cm}|m{1cm}|m{1.25cm}|m{1cm}|m{1.25cm}|m{1cm}|m{1.25cm}|米{1厘米}|}\hline\multicolumn{1}{|p{5cm}|}{\multirow{2}{*}{\textbf{土地利用/土地覆盖类别}}} &\multicolumn{2}{|c|}{\textbf{1977}} &\multicolumn{2}{|c|}{\textbf{1993}} &\multicolumn{2}{|c|}{\textbf{2006}} &\multicolumn{2}{|c|}{\textbf{2014}} \\\cline{2-9}\multicolumn{1}{|c|}{} &\textbf{面积 (km2)} &\textbf{面积 (\%)} &\textbf{面积 (km2)} &\textbf{面积 (\%)} &\textbf{面积 (km2)} &\textbf{面积 (\%)} &\textbf{面积 (km2)} &\textbf{面积 (\%)} \\\hline茂密的森林149.84 &10.10 &164.83 &11.11 &55.49 &3.74 &71.10 &4.79\\\hline开放森林&107.11 &7.22 &110.77 &7.47 &99.51 &6.71 &112.52 &7.59\\\hline\end{表格}\茶几}\end{中心}

解决方案

我试图安排它,但在 (

I am using the following syntax on Overleaf. However, the first header is spilling off into the second column. I tried using p{0.75\linewidth} as well, but it did not work. Any suggestions?

\documentclass[12pt]{article}
\begin{center}
\begin{table}[h!]
\caption{Table 17}
\begin{tabular}{|m{5cm}|m{1.25cm}|m{1cm}|m{1.25cm}|m{1cm}|m{1.25cm}|m{1cm}|m{1.25cm}|m{1cm}|}
\hline
\multicolumn{1}{|p{5cm}|}{\multirow{2}{*}{\textbf{Land Use/Land Cover Categories}}} & \multicolumn{2}{|c|}{\textbf{1977}} & \multicolumn{2}{|c|}{\textbf{1993}} & \multicolumn{2}{|c|}{\textbf{2006}} & \multicolumn{2}{|c|}{\textbf{2014}} \\
\cline{2-9}
 \multicolumn{1}{|c|}{} & \textbf{Area (km2)} & \textbf{Area (\%)} & \textbf{Area (km2)} & \textbf{Area (\%)} & \textbf{Area (km2)} & \textbf{Area (\%)} & \textbf{Area (km2)} & \textbf{Area (\%)} \\
 \hline
Dense forest & 149.84 & 10.10 & 164.83 & 11.11 & 55.49 & 3.74 & 71.10 & 4.79\\
\hline
Open forest & 107.11 & 7.22 & 110.77 & 7.47 & 99.51 & 6.71 & 112.52 & 7.59\\
\hline
\end{tabular}
\end{table}
\end{center}

解决方案

I tried to arrange it, but it would be crucial to know your full header before (MWE).

\documentclass[12pt]{article}
\usepackage{multirow}

\begin{document}

\begin{table}%[h!]
\caption{Table 17}
\begin{tabular}{|p{2.75cm}|p{1.25cm}|p{1cm}|p{1.25cm}|p{1cm}|p{1.25cm}|p{1cm}|p{1.25cm}|p{1cm}|}
\hline
\multirow{2}{*}{\parbox{2.75cm}{\textbf{Land Use/\\Land Cover\\Categories}}} & %
\multicolumn{2}{|c|}{\textbf{1977}} & \multicolumn{2}{|c|}{\textbf{1993}} & %
\multicolumn{2}{|c|}{\textbf{2006}} & \multicolumn{2}{|c|}{\textbf{2014}}\\
\cline{2-9}
 & \textbf{Area (km2)} & \textbf{Area (\%)} & \textbf{Area (km2)} & \textbf{Area (\%)} & %
\textbf{Area (km2)} & \textbf{Area (\%)} & \textbf{Area (km2)} & \textbf{Area (\%)}\\
\hline
Dense forest & 149.84 & 10.10 & 164.83 & 11.11 & 55.49 & 3.74 & 71.10 & 4.79\\
\hline
Open forest & 107.11 & 7.22 & 110.77 & 7.47 & 99.51 & 6.71 & 112.52 & 7.59\\
\hline
\end{tabular}
\end{table}

\end{document}

This code must be tuned accordingly with page margins (yours are not known) and so on but, for now, it outputs this table:

这篇关于我们如何在 Overleaf 的 longtable 中包装文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆