I want a table whose first column is aligned top, second column is aligned middle, and third column is aligned bottom; like this:

I wrote the following code:



\begin{tabular}{| p{1cm} | m{1cm} | b{1cm} |}
    x &
    A long text comes here &
    x \\


Yet, to my surprise, the outcome was "all columns aligned middle," as follows:

What did I do wrong?

  • 2
    After doing some experimenting, I found out that the long text seems to dominate. Everything else is getting aligned the way that it's aligned. Maybe you need to try adding in the multirow environment?
    – philosodad
    Dec 1, 2010 at 21:09
  • @philosodad: Yeah, I reached to the same conclusion: the long text dominates. I'll examine the multirow, but I wanted to know if the domination is a bug or something? Dec 1, 2010 at 21:51
  • You get the same behavior with \parbox[t]{1cm}{x}\parbox{1cm}{A long text comes here}\parbox[b]{1cm}{x}, and since p m and b correspond to to these kinds of parboxes, array does work the way the manual says. I'm just not sure what the bet way of dealing with this issue is.
    – frabjous
    Dec 1, 2010 at 22:02
  • @frabjous: The question is, why \parbox offers such behavior? I expect p, m, and b to align vertically at top, middle, and bottom, respectively. Dec 1, 2010 at 22:16
  • 2
    With parbox, it's not surprising. There's the active line of text. The differences between p m and b only matter when the stuff in the parbox is larger than one line. The "X"'s are just "on the line", and so the way they hang past the line don't matter. The only parbox that extends past the line is the middle one, and it gets centered, because it's m. Try making each "X" two lines of text and you'll see what p and b do, e.g., \parbox[t]{1cm}{some words}\parbox{1cm}{A long text comes here}\parbox[b]{1cm}{some words}
    – frabjous
    Dec 1, 2010 at 23:21

4 Answers 4


You could use optional arguments of \parbox for vertical alignment and vertical size. Here's a small demonstration example, I just quickly estimated the height. Inserting \vspace{0pt} is a trick for changing the base line for the alignment. Without it, we would get a lot of additional whitespace.

\begin{tabular}{| p{1cm} | p{1cm} | p{1cm} |}
    \tabbox{x} &
    \tabbox{A long text comes here} &
    \tabbox[b]{x} \\


alt text


The thing with the array package is you cannot use p{...}, m{...} and b{...} in the same table. m{...} will usually override the other two if they are present. You might just want to manually insert your vertical space or do your alignment within the multirow environment.


I will give a solution with tabularray package. In the example, h column aligns at the head, f column aligns at the foot.



\begin{tblr}{| h{1cm} | m{1cm} | f{1cm} |}
   x & A long text comes here & x \\


enter image description here


This isn't an answer per se, but rather an observation from, what I gather, a "lower" level:

\halign to .2\hsize{
  \vbox to 20pt{\hsize=.05\hsize#\vfil}&% cmr10*2=20
  \vbox to 20pt{\hsize=.10\hsize#\vfil}&
  \vtop to 20pt{\hsize=.05\hsize#\vfil}\cr
  \hfill x&long text here&x\cr
  \centerline{wtf}&is happening here&huh?\cr

enter image description here

Notice how the first 'x' is higher than the following vbox, and the last column content is lower than the middle column content, even though the explicit height definitions. Also I've no clue where does the white-space between the rows come from.

I, too, sure would like to know what is happening.

  • Your image doesn't work anymore. Could you reupload it?
    – doncherry
    Jan 15, 2012 at 21:22
  • @doncherry: sure, I did that. Thanks for the heads-up! These missing image-issues keep coming up now and again, I wonder why.
    – morbusg
    Jan 15, 2012 at 22:19
  • It looks like you're another case of meta.tex.stackexchange.com/questions/1440/…. Well, some more reuploading for me to do :). Just make sure that whenever you upload pictures, you do so through the official interface, i.e. by clicking on the respective button or pushing Ctrl+G. (I first thought your case was different because I falsely removed the i., but removing the stack. (and reuploading them) brings back your images.
    – doncherry
    Jan 15, 2012 at 22:31
  • @doncherry: oh, right, I think at the time when I originally posted this, uh, "answer", there wasn't an official interface yet in place.
    – morbusg
    Jan 15, 2012 at 22:37
  • All fixed. The problem only appear in your older posts, so that's probably the explanation.
    – doncherry
    Jan 17, 2012 at 9:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .