The table you have at the top of the page is outside the mainWrapper so its not affected by the margins applied to the mainWrapper. The bigger problem is that when you created the table you cut and pasted all of the code including the head, html, body tags so basically the structure of your page looks like this:
Code:
<html>
<head>
</head>
<html>
<head>
</head>
<body>
</body>
</html>
<body>
</body>
</html>
When it should be:
Code:
<html>
<head>
</head>
<body>
</body>
</html>
Where did you put the code for the top table? I would have put that table into the headerWrapper or wrap the page in an extra div so you can position it as one large block.