Reputation: 6012
When putting a table inside an inline-block element, the inline-block elements next to it are shifted down, instead of the tops of the elements being aligned.
<div>
<table>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
</table>
</div>
<div>Element</div>
<div>Element</div>
div {
display: inline-block;
border: 1px solid #000;
}
Why does this happen, and what can I do to prevent it?
Upvotes: 2
Views: 510
Reputation: 1297
You can try this:
div {
display: inline-block;
border: 1px solid #000;
vertical-align:top;
}
Upvotes: 1