Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a table to align between top & bottom 3

Status
Not open for further replies.

funkymonk

Technical User
Dec 18, 2000
588
GB
Does anyone know how to get a table/anything to align between the top of the page and the bottom.

I have designed a navigation image for the front page of a web site and I want it to be in the centre of the screen left to right - top to bottom depending on the resolution of the visitors machine.

roda B-)
 
give the code below a try:

<table align=&quot;center&quot; width=&quot;100%&quot;>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;100%&quot; align=&quot;center&quot; valign=&quot;middle&quot;>
<table width=&quot;80%&quot; border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot; align=&quot;center&quot; bgcolor=&quot;Aqua&quot;>
<tr>
<td width=&quot;50&quot;>o</td>
<td></td>
</tr>
<tr>
<td>l</td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>

What you will be doing is creating one table with one row and one cell and then placing another table in the open cell with all of your other cell information in it. This should center top to bottom and left to right.

Hope this helped.
 
You can also do it with css like this:
<div style=&quot;position:absolute; left:50%; top:50%&quot;>
text
</div>
 
Cool... One thing more you have to add to this is a &quot;height=&quot;100%&quot; in the first table tag.

cheers, roda B-)
 
I don't think the height attribute works on Netscape.

-Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top