0

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.

rabbitt
  • 2,558
  • 8
  • 28
  • 41
  • 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. http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html – Jason Gennaro May 30 '11 at 14:27

2 Answers2

1

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

<style>
table
{
    align: center;
    vertical-align:middle;
}
</style>
Sujit Agarwal
  • 12,348
  • 11
  • 48
  • 79
0

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;

Anish
  • 2,889
  • 1
  • 20
  • 45