Friday, March 14, 2008

Centering content on a page

How do you center a table on the page if you can’t use deprecated HTML align=center?
Here is a solution that works on all browsers except IE 6.

Assign the CSS Style property MARGIN:AUTO; to an HTML tag like DIV or TABLE. This property tells the browser to make the margins on all sides of the element equal. Which will, in turn, push the table into the center of the browser window.

No comments: