You can use the "auto" value for the left and right margins to let the browser distribute the available space equally at both sides of the inner div:
<div id='parent' style='width: 100%;'>
<div id='child' style='width: 50px; height: 100px; margin-left: auto; margin-right: auto'>Text</div>
</div>