I wonder why p columns are aligned at the bottom and b columns aligned at the top? enter image description here

created with this code:

\centering header p &
\centering header m &   
\centering header b \tabularnewline
text which is considerably longer than the width of the column  & 
text which is considerably longer than the width of the column  & 
text which is considerably longer than the width of the column 

2 Answers 2

  • p means normal cells, they are like parbox with alignment at the top line

  • b means alignment at the bottom, so the baseline is at the bottom line

  • m means alignment in the vertical center, i.e. the baseline is in the center.

So the position for alignment is meant. In your picture, the top line of the first text, the middle of the second and the bottom line of the last text are all in a line:

table cell alignment

  • 8
    Ok, I understand. My problem was that it is counter-intuitive. Nov 18, 2011 at 14:57
  • 5
    So if I understand correctly, there is no (simple) way to have a column aligned at the bottom when the other columns are specified with r, l and c? In a table \begin{tabular}{p{1cm}b{1cm}rlc} the three last columns are aligned at the bottom.
    – Arthur
    Jan 8, 2017 at 15:28

For some users who are familiar with word processors, these p and b columns in LaTeX tables are counter-intuitive. With tblr environment of LaTeX3 package tabularray, there are another two column types h and f, which will align cell text at row head and row foot, respectively:

{row\\head} & {top\\line} & {middle} & {line\\bottom} & {row\\foot} \\
{row\\head} & {top\\line} & {11\\22\\mid\\44\\55} & {line\\bottom} & {row\\foot} \\

enter image description here

  • How do h and b actually work or mean? Thankfully, you showed how they affect the alignment, but I still don't quite understand their actual meaning to link with their effects.
    – Diaa
    Jul 20, 2021 at 11:35
  • h means put text in the head of the cell, f means put text in the foot of the cell.
    – L.J.R.
    Jul 20, 2021 at 11:56
  • And what about the meaning of b and t? Is there a visual explanation of how they place the text?
    – Diaa
    Jul 20, 2021 at 14:04
  • b means put bottom line in the middle, t means put top line in the middle.
    – L.J.R.
    Jul 20, 2021 at 14:18

You must log in to answer this question.

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