Is there a way to centre a table horisontally and vertically on a page no matter what size the client screen is set to ex 800X600 or 1024X768. I want the table or contents to be in the centre(V and H) of the screen always?
This is possible, but only with some invalid markup (height is not a supported attribute in the HTML4.01 specifications, so its usefulness is seriously limited):
<table border="0" width="100%" height="100%"
cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="100%">
Your content goes here
</td>
</tr>
</table>
The above will put a 1 cell table 100% horizontal and vertically
It works with Internet Explorer, Netscape Navigator 4.x and Opera.
Netscape Navigator 6 and Mozilla only support W3C recommendations so those browsers will ignore the "height=100%" attribute and you'll lose vertical centering.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.