table placement

liunx

Guest
Hi guys<br />
<br />
Does anyone know if it is possible to centre a table on a page both vertically and horizontally?<br />
<br />
I have a table which is fine in 800x600 but I would like it to be in the centre of the page when viewed in 1024x768.<br />
<br />
I was wondering if there was a trick to it or indeed if it is possible.<br />
<br />
Thanx<br />
Jody<!--content-->Does the following work:<br />
<br />
<table valign="top" align="center"><br />
<br />
I think that should do it.<!--content-->Ooops, <br />
<br />
I meant<br />
<br />
<table valign="middle" align="center"> <br />
<br />
<br />
Sorry. :D<!--content-->Its a little tricky, depends what else is on the page. If its just the one table you can try something like:<br />
<br />
<br />
<table width=100% height=33% border=0 align=top><tr><td>& nbsp;</td></tr></table><br />
<table height=33% align=center border=1><tr><td valign=middle>your data here</td></tr></table><br />
<table width=100% height=33%border=0 align=bottom><tr><td>& nbsp;</td></tr></table><br />
<br />
<br />
or<br />
<br />
<br />
<table width=100% height=100% border=0><tr><td valign=middle align=center><br />
<table border=1><tr><td>your data here</td></tr></table><br />
</td></tr></table><br />
<br />
<br />
not sure how well the above codes will work in Netscape but should be fine in IE. <br />
<br />
I don't believe valign=middle is a valid attribute of the table tag, it is for the TR and TD tag.<br />
<br />
Regards,<br />
Kevin<!--content-->Thanks guys the nested tables worked a treat.<br />
<br />
cheers<!--content-->
 
Back
Top