Skip to content

Sunday, May 24, 2009

The perils of using display: table for layout

When using display:table (with the related table-row and table-cell) to set up columns for a layout, don’t forget to set the vertical-align property. After a while it finally dawned on me why would the padding-top of both columns seemed to be linked to each other and to the margin-top of each column’s first element: say hello to vertical-align: baseline.

1 comments:

Frozen Koi May 24, 2009 at 9:55 PM
I should've suspected something when I noticed the baselines were aligned!