views:

34

answers:

2

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

A: 

Try this:

\begin{tabular}{|m{3.5em}|b{1em}|b{1em}|b{1em}|}
\hline
%% row 1

&x1
&x2
&x3
\\\hline
%% row 2
Long Label
&1
&0
&1
\\\hline
%% row 3
Long Label
&1
&0
&1
\\\hline
\end{tabular}

For more info on table formatting see http://en.wikibooks.org/wiki/LaTeX/Tables

EDIT: changed c to b{}

Robert
that's not really centering the text vertically
iceburn
I don't know what that even means - it is centre aligned... if you are referring to wrapping, then you need to set the column size by using m{} instead of c
Robert
you're using the |c| to center the text horizontally, not vertically. look at the image i posted. i want to align the text in multiple columns so that it is centered according to the first one, which takes multiple rows. if you know how to use the m{} command, could you post an example?
iceburn
visit the wikibook I listed, you will get all you need from there
Robert
This might be a better question for tex.stackexchange.com
Crippledsmurf
it isn't there. in the example given in the "Spanning in both directions simultaneously" section it only has the same thing as in the question i linked in the op. seems this just isn't possible with latex since i can't find examples with it anywhere
iceburn
use the b{} command, instead of m{}
Robert
well, using b{} instead of m{} did align it vertically but now it isn't horizontally aligned... argh!
iceburn
then you need booktabs package, here's the documentation: http://tug.ctan.org/macros/latex/contrib/booktabs/booktabs.pdf
Robert
none of the examples in the documentation do what i need, and pretty much all of google's results point to it with at most examples taken from the documentation
iceburn
A: 
Mies
i can't get it to compile like that. i've tried searching for that array package before too because i read about it after searching on google, but i couldn't find its documentation
iceburn
I'm a dolt. It's \usepackage{array}, not \include{array}.
Mies
I see what you mean. I'm going to tinker around with it for a bit until LaTeX agrees with what I'm saying.
Mies
I forgot to add an extra alignment. So the top line should have 1 m{2cm} and 3 m{1ex}. I left out one of the m{1ex}
Mies
i compiled it and it doesn't work as intended. the text in the x1/x2/x3 columns aren't centered vertically
iceburn