Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to vertically center multiple columns in a table?

I've found an example here but that only centers one column and I can't really adapt it to my needs. What I'd like is something like this:

alt text

like image 475
iceburn Avatar asked Sep 07 '10 22:09

iceburn


1 Answers

You'll need \usepackage{array} to do this.

From what I can gather, you're looking at the m{} alignment, which wraps a paragraph at the specified point value, and vertically aligns the text to the middle of the field. For example, something like this:

\begin{tabular}{|m{2cm}|m{1ex}|m{1ex}|m{1ex}} \hline
           & x1 & x2 & x3 \\\hline
Long Label & 1  & 0  & 1  \\\hline
Long Label & 0  & 1  & 1  \\\hline
\end{tabular}
like image 80
Mies Avatar answered Dec 31 '22 15:12

Mies