如何在asp.net ..中的每个标签中设置适当的对齐方式? [英] How to set proper alignment in each tag in asp.net..?

查看:135
本文介绍了如何在asp.net ..中的每个标签中设置适当的对齐方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



标签中有一些问题.

我的行数为"n",每行包含2个.

例子
-------
-------------------------------------
EmpNo:文本框| EmpName:下拉列表
-------------------------------------
年龄:文字框|类:文本框
-------------------------------------

在这里,FirstRow和First数据是EmpNo:TextBox.

当我使用第二行时,第一行是Age:textbox.

EmpNo和Age之间没有适当的对齐方式.

我想左右对齐(文本和控件应该相同
每行顺序).

我想在CSS文件中设置像素对齐方式..

该怎么做...?


示例代码
-----------

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
-----------

<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 =服务器" CssClass ="control"宽度="100px">
允许来自代码:
< asp:TextBox ID ="txtPipeSize" runat =服务器" CssClass ="control"宽度="100px">


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">

推荐答案

拆分标签和文本框位于单独的TD标签中-

split label and textbox in separate TD tag -

<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>



谢谢&问候,
尼拉·索尼尼(Niral Soni)



Thanks & Regards,
Niral Soni


这个怎么样

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>




祝你好运
Al




Goo Luck
Al


<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>


这篇关于如何在asp.net ..中的每个标签中设置适当的对齐方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆