Div alternative to table centering

Tables are often used to center content on page, (table with 100% width all content inside and centered table content).

The W3C doesn’t like that, so how would I do that with divs?

Also, how can I make a simple 1px border around a div?