Understanding p, m, and b Columns in LaTeX Tables

columnstablesvertical alignment

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:

\begin{tabular}{|p{0.3\linewidth}|m{0.3\linewidth}|b{0.3\linewidth}|}
\hline
\centering header p &
\centering header m &   
\centering header b \tabularnewline
\hline
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 
\tabularnewline
\hline
\end{tabular}

Best Answer

  • 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