Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have some porblem in the tag.

I have "n" number of rows and each row contains 2 .

Example
-------
-------------------------------------
EmpNo : textBox | EmpName : dropdown
-------------------------------------
Age: textbox | Class : textbox
-------------------------------------

Here, FirstRow and First data is EmpNo : TextBox.

When i use second row, first is Age:textbox.

There is no proper alignment between EmpNo and Age.

I want to properly align either left or right(both text and controls should be same
order in every row) .

I want set pixel alignment in the CSS File..

How to do this...?


Sample Code
-----------
ASP.NET
<tr>
		            <td>
                        Piping Class :
                        <cc1:ComboBox ID="drpSupp"  runat="server" DropDownStyle="DropDownList" Width="50px" CaseSensitive="false" AutoCompleteMode="SuggestAppend" CssClass="WindowsStyle" ItemInsertLocation="OrdinalText">
                                <asp:ListItem Value="" Selected="True">Select
                        
                    </td>
                    <td class="Labels tdAlign">
                        Deg F :
                        <asp:TextBox ID="TextBox10" runat="server" CssClass="control" Width="100px">
                    </td>
                    </tr>

Deg C From One :
<asp:TextBox ID="TextBox11" runat="server" CssClass="control" Width="100px">
Allow from code :
<asp:TextBox ID="txtPipeSize" runat="server" CssClass="control" Width="100px">
Posted
Updated 20-Sep-11 4:15am
v2

split label and textbox in separate TD tag -

ASP.NET
<tr>
	<td>Piping Class :</td>
	<td>
		<cc1:combobox id="drpSupp" runat="server" dropdownstyle="DropDownList" width="50px" casesensitive="false" autocompletemode="SuggestAppend" cssclass="WindowsStyle" iteminsertlocation="OrdinalText" xmlns:cc1="#unknown">
		<asp:listitem value="" selected="True" xmlns:asp="#unknown">Select
	</asp:listitem></cc1:combobox></td>
	<td class="Labels tdAlign">Deg F :</td>
	<td>
		<asp:textbox id="TextBox10" runat="server" cssclass="control" width="100px" xmlns:asp="#unknown">
	</asp:textbox></td>
</tr>


Thanks & Regards,
Niral Soni
 
Share this answer
 
How about this

<table border="0" width="100%" cellpadding="1" cellspacing="0" id="table1">
<tr>
  <td width="50%" align="right">Your Label Here:</td>
  <td width="50%" align="left">Your Input Box Here</td>
</tr>
</table>



Goo Luck
Al
 
Share this answer
 
v3
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="Left">Emp No</td>
<td width="1%" align="Center">:</td>
<td align="Left"><asp:TextBox id="txtbox1" runat="server" /></td>
<td align="Left">Emp Name </td><td width="1%" align="Center">:</td><td><asp:DropDownList ID="ddllist1" runat="server" /></td>
</tr>
<tr>
<td align="Left">Age </td>
<td width="1%" align="Center">:</td>
<td align="Left"><asp:TextBox id="txtbox2" runat="server"  /></td>
<td align="Left">Emp Name </td><td width="1%" align="Center">:</td><asp:TextBox ID="txtBox3" runat="server" />
</tr>
</table>
 
Share this answer
 
v5
When u design webbased forms, consider following things.
1. use TABLE structure.
2. Give height and width in % not in px (it will give resolution indepedent design)
3. Give align all lables to right of the TD and Textboxes Left of TD
e.g.
ASP.NET
<table id="tblMain" width="100%">
<tr>
    <td width="50%">
         <asp:lable runat="server" id="lblEmpName" text="Emp Name" xmlns:asp="#unknown" />
    </td>
    <td width="50%">
         <asp:textbox id="txtEmpName" runat="server" xmlns:asp="#unknown" />
    </td>
</tr>
</table>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900