# ctable cell vertical align

I have a table like this:

\documentclass{article}
\usepackage{ctable}
\begin{document}
\ctable
[caption=Sample]
{|p{2cm}|c|}
{}
{
\hline
some multiline (2 or 3 fields) field & need to vertically center this \\ \hline
one more field & and this \\ \hline
}
\end{document}


I want cells at the second column to be vertically center aligned. Which is the simplest and best method?

-

Use an m{2in} column type rather than p{2in} (which centres its contents vertically). This is provided by the array package, already loaded by ctable:

\ctable
[caption=Sample]
{|m{2cm}|c|}


Alternatively, the multirow can also do this:

\documentclass{article}
\usepackage{ctable}% http://ctan.org/pkg/ctable
\usepackage{multirow}% http://ctan.org/pkg/multirow
\begin{document}
\ctable
[caption=Sample]
{|p{2cm}|c|}
{}
{
\hline
some multiline (2 or 3 fields) field & \multirow{3}*{need to vertically center this} \\ \hline
one more field & \multirow{2}*{and this} \\ \hline
}
\end{document}

-
Thanks, m{2cm} works perfect! –  Drakmail May 31 '12 at 17:00