What are the differences between inline-block and table-cell?
I have found these two styles are the same. Whatever you style for eg. text-align: center; verti
display:table-cell
is intended for use inside a display:table-row
, itself inside a display:table
. Improper use will result in anonymous elements being created, which may interefere negatively with other aspects of your layout.
That being said, vertical-align
has very different meanings in both. In display:inline-block
, it refers to how the element itself aligns with the surrounding elements. On the other hand, with display:table-cell
, it will affect the vertical alignment of elements inside it.