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

valign for table ?

Status
Not open for further replies.

Boomerang

Programmer
Mar 30, 2001
766
0
0
NL

I want to make a table in the center of my window. The align attribute of the table-tag works fine but how can I make the table in the middle of the heigth of the window(valign doesn't work in the table-tag)??

And if you know how to do that, does it work in IE and NC?

Erik

This is my sample code:

<body>
<table align=&quot;center&quot; height=&quot;250&quot; width=&quot;250&quot; cellspacing=&quot;0&quot; border=&quot;3&quot;>
<tr>
<td>1<td>2<td>3
</tr>
<tr>
<td>4<td>5<td>6
</tr>
<tr>
<td>7<td>8<td>9
</tr>
</table>
</body>
 
Hi Erik,

this should works

<table width=&quot;100%&quot; height=&quot;100%&quot;>
<tr>
<td valign=&quot;middle&quot; align=&quot;center&quot;>
<table height=&quot;250&quot; width=&quot;250&quot; cellspacing=&quot;0&quot; border=&quot;3&quot;>
<tr>
<td>1<td>2<td>3
</tr>
<tr>
<td>4<td>5<td>6
</tr>
<tr>
<td>7<td>8<td>9
</tr>
</table>
</td>
</tr>
</table>
</body>

hope this helps,
Chiu Chan
WebMaster & Software Engineer
emagine solutions, inc
cchan@emagine-solutions.com
 
The only safe cross-browser way to ensure table height is to use a transparent image to fill any voids.
 
Don't forget that Netscape is very picky about closing tags - so for every <TD> you need a </TD>...

Stephen
<body>
<table width=&quot;100%&quot; height=&quot;100%&quot;>
<tr>
<td valign=&quot;middle&quot; align=&quot;center&quot;>
<table height=&quot;250&quot; width=&quot;250&quot; cellspacing=&quot;0&quot; border=&quot;3&quot;>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>
<tr>
<td>4</td><td>5</td><td>6</td>
</tr>
<tr>
<td>7</td><td>8</td><td>9</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
 
Thank guys,

I will try tomorrow if it works, but I don't doubt about your experience !!

Erik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top