How do you center a table within a table?

  • Unknown's avatar

    I can’t get it to center and I have tried like twelve different tags.
    It’s pissing me off and making me very frustrated.
    And also how do you make text go into the middle of the table (vertically)?

    The code:

    <h1 style=”text-align:center;”>Welcome to iDesign4You</h1>
    <table border=”0″ cellspacing=”0″ cellpadding=”4″ width=”600″> <col span=”1″ width=”256″></col>
    <tbody>
    <tr>
    <td>
    <span style=”text-align:center;”>
    <table border=”0″ cellspacing=”0″ cellpadding=”4″ width=”500″> <col span=”1″ width=”256″></col>
    <tbody>
    <tr>
    <td>
    <span style=”text-align:justify;”>
    <h1 style=”text-align:center;” mce_style=”text-align:center;”>Welcome to iDesign4You</h1> <table style=”height: 26px;” border=”0″ width=”600″> <tbody></tbody> <tbody> <tr> <td width=”600″ valign=”top”> <table border=”1″
    <tbody> <tr valign=”center”> <td width=”235″></td> <td width=”235″></td> </tr> </tbody> </table>;</span>
    </td>
    <td>
    <span style=”font-family:verdana;color:blue;font-size:large;”>Confusing?</span></td>
    </td>
    </tr>
    </tbody></table></span>
    </td>
    </tr>
    </tbody></table>

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    I’m going to be getting the CSS upgrade soon, but first I just wanted to get my front page set up.

  • I believe the usual way is to travel back in time to 1997.

    This shows some modern centering methods:

    http://www.w3.org/Style/Examples/007/center

  • Unknown's avatar

    It doesn’t work….

  • Unknown's avatar

    Can you give us an example of what you are trying to accomplish, or an explanation?

    Nesting tables is nasty business and takes me back to my nightmare web design days of the mid to late 90’s.

  • The topic ‘How do you center a table within a table?’ is closed to new replies.