Say I have a like so:
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td>
</td>
</tr>
</table>
The margin-* attributes instruct the table to center itself within its parent element.
Is there a similar way to center the element vertically?
This is a very often requested thing to do. There’s no simple way to do vertical alignment. There’s the
vertical-alignattribute, but it’s for line-alignment of an inline element. Check out this link for different ways to do vertical-centering.Edit: Here’s another good link to get you started.