/    Sign up×
Community /Pin to ProfileBookmark

table cell alignment?

Hello Everyone:

I am crating a table for a registration page.
1. The row for username and input text box is not centered. I couldn’t figure out what I did wrong. Please review my code and give me some advises on how to correct it.

  • 2. In IE7 the username cell and input box cell are further apart. Please advise how to make the table look identical in Firefox and IE.
  • Thanks in advance.
    HTML Code:

    [code]
    <html>
    <head>
    <link rel=”stylesheet” type=”text/css” href=”main.css” />
    <title>User Registration Page</title>
    </head>

    <body>
    <form name=”registration” id=”registration” method=”post” action=”validation.php”>
    <table width=”600″ align=”center” cellspacing=”0″ cellpadding=”0″>
    <tr>
    <th colspan=”2″>User Registration Page</th>
    </tr>

    <tr><td colspan=”2″>&nbsp;</td></tr>
    <tr><td colspan=”2″>&nbsp;</td></tr>

    <tr>
    <td class=”frmelement” width=”150px”>User Name*:</td>
    <td><input class=”frm_input” type=”text” name=”user_name” id=”user_name” maxlength=”20″ value=”” /></td>
    </tr>

    <tr>
    <td colspan=”2″ class=”submission”>
    <input type=”submit” value=”Submit” />&nbsp;&nbsp;
    <input type=”reset” value=”Cancel” />
    </td>
    </tr>
    <!–
    –>
    <tr>
    <td>
    <ul class=”notice”>
    <li>Note: User name and password must be alphanumeric (e.g. trancos08)</li>
    <li>password length must be 6 characters or more</li>
    <li>register with your coregmedia or trancos email account</li>
    <li>fileds with asterisk sign are required</li>
    <ul>
    </td>
    </tr>
    </table>

    </form>
    </body>
    </html>
    [/code]

    CSS code

    [code]
    body
    {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    background-color: #cc9;
    }

    table{

    border: 1px dotted #333;
    }

    .frmelement{
    width: 150px;
    font-size: 12px;
    text-align: right;
    /* margin-left: 120px; */

    }

    .frm_input{

    width: 200px;
    height:20px;
    margin-left: 0.5em;
    margin-bottom: 5px;

    }

    .submission{
    width: 200px;
    float: left;
    text-align: right;
    margin-left: 120px;
    }

    .notice{
    margin-top: 5px;
    margin-left: 120px;
    font-size: 9px;
    color: #c60;
    }
    [/code]

    to post a comment
    HTML

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @FangDec 14.2008 — The number of columns in each row is not equal. Use 1 column for each row, [I]text-align: center[/I] for all rows except the last one.
    ×

    Success!

    Help @webdev077 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.4,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...