title: Dynamically construct empty rows for for data elements expand in asp.net (or html)
body: <p>I'm trying to create a sort of template for my project, which is just the main content (not a master page, and not user control) for several similar pages that I need.</p>
  
  <p>I'm very new to asp.net and to HTML, so I'm sure you guys can help me.</p>
  
  <p>The pattern I want to achieve looks something like this (did this in paint, so excuse me):</p>
  
  <p><img src="https://i.stack.imgur.com/hTp0G.png" alt="enter image description here"></p>
  
  <p>At the bottom there's a partial code of a form I'm trying to build (it has only the upper gridview and details view for now), but you can see my problem in the screenshot I took (the erased row has personal data): the gridview (and the detailsview) drops lower then the "SECOND CENTERED SUBTITLE". How do I keep empty lines depending on the amount of rows in the gridview? 
  Can I set a maximum amount of rows for the gridview without loosing data?</p>
  
  <p>I also add a part of the css file which is used on this form.</p>
  
  <p>THANKS!</p>
  
  <p><img src="https://i.stack.imgur.com/UPIou.png" alt="enter image description here"></p>
  
  <p><strong><code>.aspx</code> file (main content- after the master code):</strong></p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
      &lt;div class="maincontent2headers"&gt;Create New Sale&lt;/div&gt;
      &lt;div&gt;&lt;br /&gt; &lt;/div&gt;
      &lt;div class="maincontent2leftsubtitles" &gt; Select customer &lt;/div&gt;
      &lt;div class="maincontent2rightsubtitles"&gt; Custumer's Details &lt;/div&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;div class="floatleft"&gt;
          &lt;asp:GridView ID="SelectCustomerGridView" runat="server" 
              AutoGenerateColumns="False" CellPadding="4" 
              DataKeyNames="Customer_ID" DataSourceID="SqlDataSource1" 
              ForeColor="#333333" GridLines="None" 
              AllowSorting="True"&gt;
              &lt;AlternatingRowStyle BackColor="White" 
                  ForeColor="#284775" /&gt;
              &lt;Columns&gt;
                  &lt;asp:CommandField ShowSelectButton="True" /&gt;
                  &lt;asp:BoundField DataField="Customer_ID" 
                      HeaderText="Customer_ID" ReadOnly="True" 
                      SortExpression="Customer_ID" /&gt;
                  &lt;asp:BoundField DataField="First_Name" 
                      HeaderText="First_Name" SortExpression="First_Name" /&gt;
                  &lt;asp:BoundField DataField="Last_Name" 
                      HeaderText="Last_Name" SortExpression="Last_Name" /&gt;
              &lt;/Columns&gt;
              &lt;EditRowStyle BackColor="#999999" /&gt;
              &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" 
                  ForeColor="White" /&gt;
              &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" 
                  ForeColor="White" /&gt;
              &lt;PagerStyle BackColor="#284775" ForeColor="White" 
                  HorizontalAlign="Center" /&gt;
              &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
              &lt;SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" 
                  ForeColor="#333333" /&gt;
              &lt;SortedAscendingCellStyle BackColor="#E9E7E2" /&gt;
              &lt;SortedAscendingHeaderStyle BackColor="#506C8C" /&gt;
              &lt;SortedDescendingCellStyle BackColor="#FFFDF8" /&gt;
              &lt;SortedDescendingHeaderStyle BackColor="#6F8DAE" /&gt;
          &lt;/asp:GridView&gt;
          &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
              ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" 
              SelectCommand="SELECT [Customer_ID], [First_Name], [Last_Name] FROM [Customers]"&gt;
          &lt;/asp:SqlDataSource&gt;
      &lt;/div&gt;
      &lt;div class="floatright"&gt;
  
      &lt;asp:DetailsView ID="DetailsView1" runat="server" Height="50px"
          Width="125px" AutoGenerateRows="False" CellPadding="4" 
          DataKeyNames="Customer_ID" DataSourceID="SqlDataSource2" 
          ForeColor="#333333" GridLines="None"&gt;
          &lt;AlternatingRowStyle BackColor="White" 
              ForeColor="#284775" /&gt;
          &lt;CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /&gt;
          &lt;EditRowStyle BackColor="#999999" /&gt;
          &lt;FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" /&gt;
          &lt;Fields&gt;
              &lt;asp:BoundField DataField="Customer_ID" 
                  HeaderText="Customer_ID" ReadOnly="True" 
                  SortExpression="Customer_ID" /&gt;
              &lt;asp:BoundField DataField="First_Name" 
                  HeaderText="First_Name" SortExpression="First_Name" /&gt;
              &lt;asp:BoundField DataField="Last_Name" 
                  HeaderText="Last_Name" SortExpression="Last_Name" /&gt;
              &lt;asp:BoundField DataField="Phone" HeaderText="Phone" 
                  SortExpression="Phone" /&gt;
              &lt;asp:BoundField DataField="Address" HeaderText="Address" 
                  SortExpression="Address" /&gt;
              &lt;asp:BoundField DataField="eMail" HeaderText="eMail" 
                  SortExpression="eMail" /&gt;
          &lt;/Fields&gt;
          &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" 
              ForeColor="White" /&gt;
          &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" 
              ForeColor="White" /&gt;
          &lt;PagerStyle BackColor="#284775" ForeColor="White" 
              HorizontalAlign="Center" /&gt;
          &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
      &lt;/asp:DetailsView&gt;
      &lt;/div&gt;
      &lt;asp:SqlDataSource ID="SqlDataSource2" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" 
          SelectCommand="SELECT * FROM [Customers] WHERE ([Customer_ID] = @Customer_ID)"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:ControlParameter ControlID="SelectCustomerGridView" 
                  DefaultValue="NULL" Name="Customer_ID" 
                  PropertyName="SelectedValue" Type="String" /&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:SqlDataSource&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;div  class="maincontent2centeredsubtitles"&gt;
          second subtitle here&lt;/div&gt;
      &lt;br /&gt;
  
      &lt;div&gt;
      &lt;div class="floatleft"&gt;put here to float to the left&lt;/div&gt;
      &lt;div class="floatright"&gt;put here to float to the right&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br /&gt;
      &lt;center&gt;place to show the results (delete the center tags)&lt;/center&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;div &gt;
      &lt;center&gt;buttons to proceed (delete the canter tags)&lt;/center&gt;
      &lt;/div&gt;
      &lt;br /&gt;
  
      &lt;div&gt;
      &lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Part of the <code>css</code> that concerns this code:</p>
  
  <pre><code>.floatleft
  {
      float:left;
      margin-left:5px;
      margin-right:5px;
  }
  
  .floatright
  {
      float:right;
      margin-right:5px;
      margin-left:5px;
  }
  
  .maincontent2headers
  {
      font-family: 'Arial Black';
      font-size: xx-large; 
      color: #465767;
      text-align: center;
      vertical-align: middle;
      margin-bottom: 0px; 
      width:auto;
  }
  
  .maincontent2centeredsubtitles
  {
      font-family: 'Arial Black'; 
      font-size: small; 
      color: #465767; 
      text-align: center;
      vertical-align: middle;
  }
  
  .maincontent2leftsubtitles
  {
      font-family: 'Arial Black'; 
      font-size: small; 
      color: #465767; 
      float:left;
      margin-left:5px;
      margin-right:5px;
  
  }
  
  .maincontent2rightsubtitles
  {
      font-family: 'Arial Black'; 
      font-size: small; 
      color: #465767; 
      float:right;
      margin-left:5px;
      margin-right:5px;
  }
  
  .centeredtext
  {
      text-align:center;
  }
  </code></pre>