0
votes

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.

2
If you are using the table to design the Web page, you should consider reworking the code. You should avoid putting all your content in a table. It is bad practice. stackoverflow.com/questions/83073/… - Jason Gennaro

2 Answers

1
votes

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

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

if you want to center your table.you can use margin-left:auto; if you want to center your text inside table you can use text-align:center;