在 \parbox 中将文本居中

在 \parbox 中将文本居中

我以前\parbox可以自动换行,但文本应该居中。我该怎么办?

在此处输入图片描述

\begin{table}[H]
    \centering
        \begin{tabular}{cW{5}W{5}}
        \toprule
        & {\bf Cost} & {\bf Benefit}\\
        \midrule
        \multirow{3}{*}{\bf Social} & Possible land competition & Less air pollution \\
                                & \multirow{2}{*}{\parbox{5cm}{Possible increase of extraction of wood from forest}} & Less medical expenses \\
                                & & More labour available \\
            \bottomrule
        \end{tabular}
\end {table}

答案1

我认为你做的标记比需要的要复杂得多(并且请始终使你的例子完整,以便人们可以运行它们)类似于:

在此处输入图片描述

\documentclass{article}
\usepackage{array,booktabs}
\begin{document}

\noindent X \dotfill X

\begin{table}
\centering
\begin{tabular}{c*{2}{>{\centering\arraybackslash}m{4.9cm}}}
\toprule
& \bfseries Cost & \bfseries Benefit\\
\midrule
\bfseries Social
& 
Possible land competition 

Possible increase of extraction of wood from forest
& 
Less air pollution 

Less medical expenses

More labour available \\
\bottomrule
\end{tabular}
\end {table}

\end{document}

相关内容