Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alignment of a table cell
Message
From
23/04/2006 02:03:58
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01115738
Message ID:
01115771
Views:
7
>When I do that the text is left justified. You must have a style applied that is setting text centered.

I am trying to see what is conflicting in the following code which could cause that reaction. It seems like a bug in the way .NET is generating the HTML. I have a DIV but it is opened and closed. It shouldn't affect the layout. Here is the code. If you try it, you will see the behavior that it gives with the text "Login Information" which should be aligned left, which is the default, right over the two input fields for the username and password.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="32%"><font face="Arial"> </font></td>
    <td width="43%"> </td>
    <td width="24%"> 
      <div align="right"><font face="Arial"> </font></div>
    </td>
    <td width="1%"><font face="Arial"> </font></td>
  </tr>
  <tr> 
    <td width="32%"> 
      <div align="center"><font face="Arial, Helvetica, sans-serif"><b><font size="3">Login
       </font></b></font></div>
    </td>
    <td width="43%"> 
      <table border="0" cellspacing="0" cellpadding="0" width="238">
          <tr> 
            <td class="label"> 
              <table class="form" border="0" cellspacing="0" cellpadding="0" width="93%">
                <tr> 
                  <td class="label" width="39%"></td>
                  <td class="field" width="61%" align=left>Login Information</td>
                </tr>
                <tr> 
                  <td class="label" width="39%">User ID:</td>
                  <td class="field" nowrap width="61%"> 
                    <input type="text" size="20" maxlength="10" id="Username" name="Username" value="">
                        </td>
                </tr>
                <tr> 
                  <td nowrap class="label" width="39%">Password:</td>
                  <td class="field" nowrap width="61%"> 
                    <input type="password" size="20" maxlength="10" id="Password" name="Password" value="">
                        </td>
                </tr>
                <tr> 
                  <td nowrap class="label" width="39%"> </td>
                  <td class="field" nowrap width="61%" align=left> 
                    <input type=submit value="Login" name="submit">
                  </td>
                </tr>
              </table>
            </td>
          </tr>
      </table>
      <font face="Arial, Helvetica, sans-serif"><b></b></font></td>
    <td width="24%"> </td>
    <td width="1%"> </td>
  </tr>
  <tr> 
    <td width="32%"> </td>
    <td width="43%"> </td>
    <td width="24%"> </td>
    <td width="1%"> </td>
  </tr>
</table>
The funny thing about that is that the reendering is ok in the Design panel. But, when you run that in an aspx page, it will not be left aligned.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform