Hi guys.
Is there a way to wrap a text while centerting the whole column in a table?
Thanks.
Yotam
Graphics, Figures & Tables ⇒ Centering while text wrapping in table
NEW: TikZ book now 40% off at Amazon.com for a short time.

Centering while text wrapping in table
Perhaps a more descriptive query would help us to provide effective help. Anyway, the array package offers some features that could help:
Code: Select all
\documentclass{article}
\usepackage{array}
\usepackage{lipsum}
\begin{document}
\begin{tabular}{>{\centering\arraybackslash}p{4cm}}
\lipsum[1]
\end{tabular}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Centering while text wrapping in table
gmedina, the solution you gave me worked perfectly.
The table was:
and I fixed it to:
Can you please explain the syntax or point to someplace were there is an explanation?
The table was:
Code: Select all
\begin{table} %table pKa* calculation
\begin{center}
\begin{tabular}{|c|p{1.8cm}|c|c|c|c|c|c|c|}
\hline
molecule
&solution composition&$pK_a$
&$\lambda^{acid}_g$ &$\lambda^{acid}_{ex}$ &$\lambda^{base}_g$ &$\lambda^{base}_{ex}$
&$pK_a^*$ &$-\Delta pK_a ^*$
\\ \hline
\cellcolor[gray]{0.8}
&$X_{weight}^\ce{MeOH}$ &\cellcolor[gray]{0.8} &\multicolumn{4}{c}{nm} &\cellcolor[gray]{0.8} &\cellcolor[gray]{0.8} \\ \hline
\multirow{6}{*}{APMS}
&0 &3.4
&349 &378 &398 &476
&16.3 &0\\ \cline{2-9}
...
\end{table}
Code: Select all
\begin{table} %table pKa* calculation
\begin{center}
\begin{tabular}{|c|>{\centering\arraybackslash}p{1.8cm}|c|c|c|c|c|c|c|}
\hline
molecule
&solution composition&$pK_a$
&$\lambda^{acid}_g$ &$\lambda^{acid}_{ex}$ &$\lambda^{base}_g$ &$\lambda^{base}_{ex}$
&$pK_a^*$ &$-\Delta pK_a ^*$
\\ \hline
\cellcolor[gray]{0.8}
&$X_{weight}^\ce{MeOH}$ &\cellcolor[gray]{0.8} &\multicolumn{4}{c}{nm} &\cellcolor[gray]{0.8} &\cellcolor[gray]{0.8} \\ \hline
\multirow{6}{*}{APMS}
&0 &3.4
&349 &378 &398 &476
&16.3 &0\\ \cline{2-9}
...
\end{table}
Centering while text wrapping in table
The first pages of the array package documentation contain an explanation.yotama9 wrote:...Can you please explain the syntax or point to someplace were there is an explanation?
1,1,2,3,5,8,13,21,34,55,89,144,233,...