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:
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
2010-09-07 22:55:27
that's not really centering the text vertically
iceburn
2010-09-07 22:58:41
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
2010-09-07 23:02:36
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
2010-09-07 23:05:09
visit the wikibook I listed, you will get all you need from there
Robert
2010-09-07 23:08:58
This might be a better question for tex.stackexchange.com
Crippledsmurf
2010-09-07 23:22:23
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
2010-09-07 23:23:31
use the b{} command, instead of m{}
Robert
2010-09-07 23:26:54
well, using b{} instead of m{} did align it vertically but now it isn't horizontally aligned... argh!
iceburn
2010-09-07 23:32:10
then you need booktabs package, here's the documentation: http://tug.ctan.org/macros/latex/contrib/booktabs/booktabs.pdf
Robert
2010-09-07 23:36:16
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
2010-09-07 23:41:56
A:
Mies
2010-09-07 22:56:50
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
2010-09-07 23:00:48
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
2010-09-07 23:09:28
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
2010-09-07 23:13:14
i compiled it and it doesn't work as intended. the text in the x1/x2/x3 columns aren't centered vertically
iceburn
2010-09-07 23:13:31