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!

valign="middle"

Status
Not open for further replies.

peterpann

Programmer
Jun 19, 2007
63
GB
The following code produces concentric rectangles in FX, Opera and Chrome, but at the top of the page. How can it
appear in the middle of the page ? How to make it the same in IE ? How can it be done with CSS, ignoring borders, cellpadding and cellspacing ?
<code>
<table align="center" valign="middle" width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="brown">
<table width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="red">
<table width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="yellow"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</code>
 
It's ok to use a table for a table, but I think what you want is to enclose your table with in a <div> tag. In which case:

<code>
<div align="center">
<table align="center" valign="middle" width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="brown">
<table width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="red">
<table width="50%" height="50%">
<tr>
<td align="center" valign="middle" bgColor="yellow"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</code>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top