title: Align ASP controls in table using CSS
body: <p>I'd like to align ASP labels and textBoxes, but I lost in CSS forest. The align of controls are bad. (Sorry my CSS code is bad.) I'd like to put the controls below each other in pairs (Label+TextBox). Help, please.</p>
  
  <p><strong>aspx page:</strong></p>
  
  <pre><code>&lt;asp:TableCell ID="tc0" runat="server" CssClass="searchTableLabelsCell"&gt;
      &lt;asp:Label ID="lblrefNo" runat="server" Text="RefNo:" CssClass="searchLabel"&gt;
      &lt;/asp:Label&gt;
      &lt;asp:TextBox ID="txtRefNo" runat="server" CssClass="textBoxes" MaxLength="50"&gt;
      &lt;/asp:TextBox&gt;
      &lt;asp:Label ID="lblFrom" runat="server" Text="From:" CssClass="searchLabel"&gt;
      &lt;/asp:Label&gt;
      &lt;asp:TextBox ID="txtFrom" runat="server" CssClass="textBoxes" MaxLength="50"&gt;
      &lt;/asp:TextBox&gt;
      &lt;asp:Label ID="lblTo" runat="server" Text="To:" CssClass="searchLabel"&gt;
      &lt;/asp:Label&gt;
      &lt;asp:TextBox ID="txtTo" runat="server" CssClass="textBoxes" MaxLength="50"&gt;
      &lt;/asp:TextBox&gt;
      &lt;asp:Label ID="lblCc" runat="server" Text="Cc:" CssClass="searchLabel"&gt;
      &lt;/asp:Label&gt;
      &lt;asp:TextBox ID="txtCc" runat="server" CssClass="textBoxes" MaxLength="50"&gt;
      &lt;/asp:TextBox&gt;
  &lt;/asp:TableCell&gt;
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>.searchTableLabelsCell
  {
      font: 12px Verdana;
      width: 300px;      /* it must be 300px */
      border-style: none;
      padding: 0px;
      margin: 0px;
      background-color: Aqua;
  }
  .searchLabel
  {
      float: left;
      margin-right: 0px;
      font: 13px Verdana;
      text-align: right;
      width: 50px;
      background-color: Blue;
      margin-top:15px;
      position: relative;
      left: 0px;
  }
  .textBoxes
  {
      width: 120px;
      margin-top: 12px;
      position: relative;
      left: 0px;
      resize: none;
  }
  </code></pre>
  
  <p><strong>Requested align:</strong></p>
  
  <pre><code>    lblrefNo    txtRefNo               &lt;!--CELL WIDTH --&gt;
       lblFrom    txtFrom                &lt;!--CELL WIDTH --&gt;
         lblTo    txtTo                  &lt;!--CELL WIDTH --&gt;
         lblCc    txtCc                  &lt;!--CELL WIDTH --&gt;
  </code></pre>
  
  <p><strong>IE (bad):</strong></p>
  
  <pre><code>    lblrefNo            txtRefNo lblFrom    txtFrom &lt;!--CELL WIDTH --&gt;
      lblTo    txtTo lblCc    txtCc                   &lt;!--CELL WIDTH --&gt;
  </code></pre>
  
  <p><strong>Chrome (bad):</strong></p>
  
  <pre><code>    lblrefNo        txtRefNo lblFrom
      txtFrom lblTo
                          txtTo
      lblCc    txtCc
  </code></pre>