rabbitt rabbitt - 1 month ago 18
HTML Question

Center content horizontally and vertically in HTML?

I have a table which surrounds all the content of a webpage, I would like to center this table horizontally and vertically inside the browser window. It is a much smaller content area than that of the average browser so there should be no issues.

Any help is greatly appreciated.

Answer

add this code to the top of the html file within the HEAD tags:

<style>
table
{
    align: center;
    vertical-align:middle;
}
</style>