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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I ain't a newbie, but it sure will sound like it....

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
0
0
CA
hi.

I have a table. This table has one row and three columns. The first column has another table in it. The second just has a picture, the third has another table. I want all of this to display in the middle of the screen. What are the properties I'd have to set with HTML to do this?

I tried this line for the parent table:
<table align = &quot;center&quot; valign = &quot;center&quot;>
but no go. I also tried &quot;middle&quot; instead of center for the valign. Any thoughts?

Thanks,
Jack
 
If you want the main table centered, why not use the <center></center> tags before and after the main table, not as part of it? Or have I mis-understood?
 
Hi Paul,

The <center> tags will only align horizontally.
I need my table to be horizontally and vertically centered regardless of what resolution the user has set on their monitor.

Jack
 
The valign attribute should be &quot;middle&quot; and it belongs in the table data cells, so:

<center>
<table ...>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot;> content </td>
<td align=&quot;center&quot; valign=&quot;middle&quot;> content </td>
<td align=&quot;center&quot; valign=&quot;middle&quot;> content </td>
</tr>
</table>
</center>

I think that should do it! John Hoarty
jhoarty@quickestore.com
 
That will just vertically align his content in the table cells, not the entire table itself.

When I wanted to achieve this affect, I used tables (stop groaning)

Create a frame page with a top, middle, and bottom frame. Your table will go in the middle frame, and set the middle frame's height to be slightly larger than your table (2px, or so) Then, the top and bottom frames just need a null html page loaded into them with their height values set to a variable amount. This way, they'll resize to the browser window, leaving your table in the middle frame aligned in the center.
 
I had to do this as well. I created a large table with one cell that was 100% the width and 100% the height of the screen. I then set the align and valign properties of that cell to center and middle and added the images/tables/text that was going in there.

Hope this helps.

Brenda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top