Link to home
Start Free TrialLog in
Avatar of xiangenhu
xiangenhu

asked on

Center (vertical and horizontal) a table in a table cell

I tried to insert a table in a cell of another table. I would like to have the new table centered (both V and H). No matter what I do, the new table always at the top of the cell (center is working, but not valign="middle").
Avatar of messentary
messentary

Have you tried adding a <div="center"> tag within the cell?  i.e.  
<table border="1" width="100%" height="383">
  <tr>
    <td width="50%" height="377"><div align="center"><center><table border="1" width="59%">
      <tr>
        <td width="50%">&nbsp;</td>
        <td width="50%">&nbsp;</td>
      </tr>
    </table>
    </center></div></td>
    <td width="50%" height="377"></td>
  </tr>
</table>

ASKER CERTIFIED SOLUTION
Avatar of MasseyM
MasseyM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Massey,

Isn't that exactly what I said?  Are you trying to grab points by repeating answers?

Ummm... No.  Yours doesn't work :)

YOu only span 383 pixels up and down... My screen is 1600x1200, So it wont't work on mine :)

Also, you don't have the horzontal align correct.... So, check yourself before accusing others...

Later.

Matt
the table sizes are completely irrelovent and will be adjusted to the users preference.  The answer to his question was with the new table added within the cell.
besides, the key is <div align="center"><center><table> within the <td>. It worked for me on both IE and Netscape
Ok.  You may reject my answer if you like... No worries.. I don't need the points.. Just trying to help...

sorry
Massey,
I know you know what you're talking about, and both our answers will work.  But being part of EE, you should know to only place comments until asked to repost.
I suggested you  to use Macromediadreamweaver,It's very
easy.  : )
Fixed the -1 problem on this question.
Escrow points corrected.

kb
Community Support Moderator
Experts Exchange