title: Vertically aligning a table in a page (ASP.NET)
body: <p>I have an iFrame which has it's source set to another aspx page.</p>
  
  <p>The child aspx page is simple, it just has a table with two rows and two columns (two labels and two controls inside the table).</p>
  
  <p>Problem is centering. The iFrame's height is 425 px. The table (in the child aspx page) is not that tall. It centers horizontally alright, the problem is getting it to center vertically. Here's a cheesy graphical representation:</p>
  
  <p>Transform this</p>
  
  <pre><code>iFrame
  ---------------
  |    ----     |
  |    |Tb|     |
  |    ----     |
  |             |
  |             |
  ---------------
  </code></pre>
  
  <p>Into this:</p>
  
  <pre><code>iFrame
  ---------------
  |             |
  |    ----     |
  |    |Tb|     |
  |    ----     |
  |             |
  ---------------
  </code></pre>
  
  <p>And, of course, my existing code:</p>
  
  <pre><code>&lt;table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0&gt;
  &lt;tr&gt;&lt;td width="100%" height="100%" valign="middle"&gt;
  &lt;table style="margin:0 auto" cellpadding=0 cellspacing=0&gt;
      &lt;tr&gt;
          &lt;td class="style2"&gt;
              Date:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;/td&gt;
          &lt;td class="style3"&gt;
      &lt;asp:TextBox ID="txtDate" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;asp:CalendarExtender CssClass="cal_Theme1" ID="CalendarExtender1"
          runat="server" PopupButtonID="txtDate" TargetControlID="txtDate"&gt;
      &lt;/asp:CalendarExtender&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="style2"&gt;
              &amp;nbsp;&lt;/td&gt;
          &lt;td class="style3"&gt;
              &amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="style2"&gt;
      Reasons:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;/td&gt;
          &lt;td class="style3"&gt;
      &lt;asp:ListBox ID="txtReasons" runat="server" Width="266px" 
          SelectionMode="Multiple"&gt;&lt;/asp:ListBox&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="style2"&gt;
              &amp;nbsp;&lt;/td&gt;
          &lt;td class="style3"&gt;&lt;div align=right&gt;&lt;br /&gt;
              &lt;asp:LinkButton ID="GetPolicy" runat="server" BackColor="#20548E" 
                   BorderColor="#20548E" BorderStyle="Solid" Font-Names="Tahoma" Font-Size="Small" 
                   Font-Underline="False" ForeColor="White" Height="16px" Width="85px"&gt;          &lt;center&gt;
                   Send To Batch&lt;/center&gt;&lt;/asp:LinkButton&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks,</p>
  
  <p>Jason</p>