文本垂直超出表格限制且多行

文本垂直超出表格限制且多行

我想垂直调整表格大小以便文本能够适合。

\begin{table}[!htb]
\centering
\caption{Examples of waterproofing of molded pulp products.}
\setlength\heavyrulewidth{0.25ex}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{lp{7cm}l}
    \toprule
    \textbf{Base material} & \textbf{Additives} & \textbf{Reference}\\
    \midrule
    Recycled paper pulp & Diatomite and bentonite, pore structures with good adsorption performance & \cite{bibid}\\
    Softwood pulp & Low molecular weight and highly cationic coagulant followed by a high molecular weight anionic flocculent. Optimal degrees of grease-proofing and water proofing & \cite{bibid}\\
    Unbleached Kraft pulp & \multirow{2}{7cm}{Palm oil from empty fruit bunch (EFB) and AKD (alkyl ketene dimer). The addition of EFB provided a higher water contact angle, that gave better water resistance properties} & \cite{bibid} \\
    Old newspapers & & \cite{bibid}\\
    \bottomrule
\end{tabular}
\end{adjustbox}
\label{table1}%

\茶几}%

在此处输入图片描述

答案1

无需使用multirowadjustbox包。只需使用tabularx环境并允许 LaTeX 找到最佳换行符。我建议您在第一列和第二列中都允许换行。下面的代码还安排了每个单元格中第二行和后续行的悬挂缩进。

在此处输入图片描述

我不禁要说,设置\setlength\heavyrulewidth{0.25ex}使得顶部和底部规则看起来相当繁重。

\documentclass{article}
\usepackage{tabularx,booktabs,ragged2e}
\newcolumntype{L}{>{\RaggedRight\arraybackslash%
    \hangafter=1\hangindent=1em}X} % allow hyphenation
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash%
    \hangafter=1\hangindent=1em}p{#1}} % allow hyphenation
\newlength\mylen
\settowidth\mylen{Unbleached Kraft} % width of first column
\usepackage[skip=0.333\baselineskip]{caption} % optional

\begin{document}
\begin{table}[!htb]
\caption{Examples of waterproofing of molded pulp products.}
\label{table1}
\setlength\heavyrulewidth{0.25ex}
\begin{tabularx}{\textwidth}{@{} P{\mylen} L l @{}}
    \toprule
    \textbf{Base material} & \textbf{Additives} & \textbf{Ref.}\\
    \midrule
    Recycled paper pulp & Diatomite and bentonite, pore structures with good adsorption performance & \cite{bibid}\\
    \addlinespace
    Softwood pulp & Low molecular weight and highly cationic coagulant followed by a high molecular weight anionic flocculent. Optimal degrees of grease-proofing and waterproofing. & \cite{bibid}\\
    \addlinespace
    Unbleached Kraft pulp, old news\-papers & Palm oil from empty fruit bunch (EFB) and AKD (alkyl ketene dimer). The addition of EFB provided a higher water contact angle, that gave better water resistance properties. & \cite{bibid,bibid} \\
    \bottomrule
\end{tabularx}
\end{table}
\end{document}

相关内容