 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
speaky
Joined: 01 Jul 2004 Posts: 5
|
Posted: Thu Jul 01, 2004 2:31 am Table alignment |
|
|
|
Hey,
I have laid out my web site using tables and was wondering if anyone knew how to center the table vertically?
I have set the table up with align="center" to center it horizontally on the page but the table is at the top of the browser...
Can anyone help? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8301 Location: Castle Pines North, CO USA
|
Posted: Thu Jul 01, 2004 3:53 am |
|
|
|
You could try valign="middle" |
|
speaky
Joined: 01 Jul 2004 Posts: 5
|
Posted: Thu Jul 01, 2004 5:02 am |
|
|
|
I've tried that and it only seems to move the page from left to right not up and down the browser window?!?!
Is it possible to align the table this way? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8301 Location: Castle Pines North, CO USA
|
Posted: Thu Jul 01, 2004 5:41 am |
|
|
|
Can you post some of your code / or an URL? I think I understand what you want to do - but if I could see what you have done - it would help.
Otherwise I think you might be trying to do something like:
| Code: |
<table border="0" width="100%" id="main" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td align="center">
<table border="0" width="90%" id="content" cellspacing="0" cellpadding="0">
<tr>
<td align="center" width="90%"> </td>
</tr>
</table>
</td>
</tr>
</table> |
|
|
mjpliv

Joined: 11 May 2004 Posts: 406 Location: Nova Scotia
|
Posted: Fri Jul 02, 2004 3:52 am |
|
|
|
To use VALIGN=CENTER you have to pre-determine the height of your page by enclosing it inside of a table. Unless you limit a page height some way then the HTML has no way of knowing where the vertical "center" is.
Once you have created an all encompassing table then the table you are trying to center can be manipulated as table data. In this example I used 100% of the available space for the encompassing table size -
| Code: |
<html>
<head>
<title>Nested Tables Example</title>
</head>
<body>
<table width="100%" height="100%" borders=0 cellpadding=0 cellspacing=0>
<tr>
<td width=100% align=center valign=center border=1>
<table width=450>
<tr>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
</tr>
<tr>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
</tr>
<tr>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
<td width=150 align=center>Table Stuff Here</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html> |
which produces this page -
Http://www.buildersmatrix.com/info/nestingtest.html |
|
speaky
Joined: 01 Jul 2004 Posts: 5
|
Posted: Wed Jul 07, 2004 5:45 am |
|
|
|
| Cheers, got it sorted now... (",) |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|