gpt4 book ai didi

c# - 使用 ASP.Net 将标签右对齐

转载 作者:太空宇宙 更新时间:2023-11-03 19:07:14 26 4
gpt4 key购买 nike

我在 ASP.NET 页面上有一个标签。现在,它看起来像这样:

enter image description here

我希望它看起来像这样:

enter image description here

我试过使用 DIV 标签,我试过在 <asp:Label> 中使用 Style="text-align: right"标签,两者都不起作用。有什么建议吗?

编辑:根据第一条评论,这一切都在表格标签内:

<asp:Panel ID="Panel2" runat="server" BackColor="#0f6fc6" Height="110px" Width="780px">
<table style="width:780px">
<tr>
<td style="width:90px">
<asp:Label ID="lblFunct" runat="server" Font-Bold="True" Text="Function" ForeColor="White"></asp:Label>
</td>
<td style="width:240px">
<asp:DropDownList ID="ddlFunction" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlFunction_SelectedIndexChanged" Width="230px">
</asp:DropDownList>
</td>
<td style="width:120px">
<asp:Label ID="lblRole" runat="server" Font-Bold="True" Text="Role" ForeColor="White"></asp:Label>
</td>
<td style="width:240px">
<asp:DropDownList ID="ddlRole" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlRole_SelectedIndexChanged" Width="230px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblProd" runat="server" Font-Bold="True" Text="Prod Tasks" ForeColor="White"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlTask" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlTask_SelectedIndexChanged" Width="230px">
</asp:DropDownList>
</td>
<td>
<asp:Label ID="lblOffprod" runat="server" Font-Bold="True" Text="Off Prod Tasks" ForeColor="White"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlOffprod" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlOffprod_SelectedIndexChanged" Width="230px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2">
<asp:RadioButtonList ID="rblPlatform" runat="server" EnableTheming="True" Font-Size="XX-Small" Height="10px" RepeatColumns="2" Visible="false" Width="270px" ForeColor="White" Font-Bold="True" TextAlign="Left">
<asp:ListItem Selected="True" Value="0">Facets </asp:ListItem>
<asp:ListItem Value="1">Non-Facets</asp:ListItem>
</asp:RadioButtonList>
</td>
<td colspan="2">
<asp:Label ID="lblAccountName" runat="server" Text="Label" ForeColor="White" Visible="true" Style="text-align: right"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>

最佳答案

尝试这样的事情:

<div style="text-align:right">
<asp:Label ID="myLabel" runat="server" Text="Label"></asp:Label>
</div>

关于c# - 使用 ASP.Net 将标签右对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25245839/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com