Centering text in \parbox
3,117
I think you are making the markup far more complicated than needed (and please always make your examples complete so people can run them) Something like:
\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}
Related videos on Youtube
Author by
Stefano
L'esperimento dello Schiehallion è stato un esperimento scientifico del XVIII secolo — pensato e progettato in gran parte da Henry Cavendish, ma eseguito dall'astronomo Nevil Maskelyne — per tentare una misurazione della densità della Terra o, utilizzando le parole dello stesso Maskelyne, per rendere «palpabile la gravitazione universale della materia».
Updated on October 21, 2020Comments
-
Stefano about 3 years
I used
\parbox
to auto-wrap the text, but it should be centered. How can I do?\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}
-
touhami about 8 yearstry
\parbox{5cm}{\centering Possible increase of extraction of wood from forest}
-
Bernard about 8 yearsWhere is the
W
column type defined? -
David Carlisle about 8 yearsThere is no need to use parbox here you can simply specify a width instead of
*
to multirow and it will use ap
column. You shouldn't be using\bf
in latex (it is not defined by default)
-