I've got the following page structure:
<div class="main-container">
<div class="content">
<table>
</table>
</div>
</div>
I want the outher div main-container
to have max-width: 800px;
and the inner div to be wrapped around a table and to have the same with as the table. Also <div class="content">
should be centered inside his parent div - main-container
. What am I doing wrong here? jsfiddle
Working example: jsfiddle
I had a similar issue. Setting
margin-left: auto;
margin-right: auto;
on the inner div worked for me.