title: Align a label to the right using ASP.Net
body: <p>I have a label on an ASP.NET page.  Right now, it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/arE5O.jpg" alt="enter image description here"></p>
  
  <p>What I want it to look like is like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Mr4HA.jpg" alt="enter image description here"></p>
  
  <p>I've tried using a DIV tag, and I've tried using Style="text-align: right" in the <code>&lt;asp:Label&gt;</code> tag, neither of which worked.  Any suggestions?</p>
  
  <p>EDIT: As per the first comment, this is all inside a table tag:</p>
  
  <pre><code>&lt;asp:Panel ID="Panel2" runat="server" BackColor="#0f6fc6" Height="110px" Width="780px"&gt;
     &lt;table style="width:780px"&gt;
        &lt;tr&gt;
           &lt;td style="width:90px"&gt;
              &lt;asp:Label ID="lblFunct" runat="server" Font-Bold="True" Text="Function" ForeColor="White"&gt;&lt;/asp:Label&gt;
           &lt;/td&gt;
           &lt;td style="width:240px"&gt;
              &lt;asp:DropDownList ID="ddlFunction" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlFunction_SelectedIndexChanged" Width="230px"&gt;
              &lt;/asp:DropDownList&gt;
           &lt;/td&gt;
           &lt;td style="width:120px"&gt;
              &lt;asp:Label ID="lblRole" runat="server" Font-Bold="True" Text="Role" ForeColor="White"&gt;&lt;/asp:Label&gt;
           &lt;/td&gt;
           &lt;td style="width:240px"&gt;
              &lt;asp:DropDownList ID="ddlRole" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlRole_SelectedIndexChanged" Width="230px"&gt;
              &lt;/asp:DropDownList&gt;
           &lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;
              &lt;asp:Label ID="lblProd" runat="server" Font-Bold="True" Text="Prod Tasks" ForeColor="White"&gt;&lt;/asp:Label&gt;
           &lt;/td&gt;
           &lt;td&gt;
              &lt;asp:DropDownList ID="ddlTask" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlTask_SelectedIndexChanged" Width="230px"&gt;
              &lt;/asp:DropDownList&gt;
           &lt;/td&gt;
           &lt;td&gt;
              &lt;asp:Label ID="lblOffprod" runat="server" Font-Bold="True" Text="Off Prod Tasks" ForeColor="White"&gt;&lt;/asp:Label&gt;
           &lt;/td&gt;
           &lt;td&gt;
              &lt;asp:DropDownList ID="ddlOffprod" runat="server" AutoPostBack="True" CssClass="textbox" Height="20px" OnSelectedIndexChanged="ddlOffprod_SelectedIndexChanged" Width="230px"&gt;
              &lt;/asp:DropDownList&gt;
           &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td colspan="2"&gt;
              &lt;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"&gt;
                 &lt;asp:ListItem Selected="True" Value="0"&gt;Facets &lt;/asp:ListItem&gt;
                 &lt;asp:ListItem Value="1"&gt;Non-Facets&lt;/asp:ListItem&gt;
              &lt;/asp:RadioButtonList&gt;
           &lt;/td&gt;
           &lt;td colspan="2"&gt;
              &lt;asp:Label ID="lblAccountName" runat="server" Text="Label" ForeColor="White" Visible="true" Style="text-align: right"&gt;&lt;/asp:Label&gt;
           &lt;/td&gt;
        &lt;/tr&gt;
     &lt;/table&gt;
  &lt;/asp:Panel&gt;
  </code></pre>