views:

40

answers:

2

I work on C# Asp.net

Main div ---- table

want to show this div on middle of the form.i want to build a login form.my table contain

User name:**(it's a lable,on browser it's broken like user
                                                       name : show why?)**
password:

<div id="main">

<table width="600px" border="1">
            <tr>
                <td>
<asp:Label ID="Label1" runat="server" CssClass="cssLabel" Text="User Name :"></asp:Label>
                </td>


                <td>
 <asp:Label ID="Label2" runat="server" CssClass="cssLabel" Text="Password :"></asp:Label>
                </td>
            </tr>
        </table>

</div>

want to show div on middle of the form? and why my lable text are going to broken how to solve it?

if u gone to google.com than you see text box take position on middle of the frame.i want this .i want my controls also take position on the middle of the frame.How to do that?

+1  A: 

You can use this to show idiv n the middle of the form:-

<div style="margin-left:auto;margin-right:auto;">Put the controls here </div>
Sandeep
You may want to accept the answers so that others can get motivated...
Sandeep
+1  A: 

You've edited your question now so this doesn't give you the exact code you need, but would help you work it out / others who view your question with a similar problem. So here goes... you need something like this:

<style type="text/css">
    .wrp { width: 100%; text-align: center; }
    .frm { text-align: left; width: 500px; margin: auto; border: 1px solid black; }
    .fldLbl { white-space: nowrap; }
</style>

<div class="wrp">
    <div class="frm">
        <span class="fldLbl">User name:</span>
    </div>
</div>
Mr Grok