Vertikal Ausrichtung einer Tabelle in einer Seite (ASP.NET)

Habe ich ein iFrame, das hat seine Quelle in eine andere aspx-Seite.

Dem Kind aspx-Seite ist einfach, es muss nur eine Tabelle mit zwei Zeilen und zwei Spalten (zwei labels und zwei Kontrollen innerhalb der Tabelle).

Problem ist die Zentrierung. Die iFrame-Höhe ist 425 px. Die Tabelle (in der das Kind aspx-Seite) ist nicht so groß. Es dreht sich horizontal in Ordnung, das problem ist, wie es den center vertikal. Hier ist ein kitschig grafische Darstellung:

Verwandeln diese

iFrame
---------------
|    ----     |
|    |Tb|     |
|    ----     |
|             |
|             |
---------------

In diesem:

iFrame
---------------
|             |
|    ----     |
|    |Tb|     |
|    ----     |
|             |
---------------

Und, natürlich, mein bestehender code:

<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
<tr><td width="100%" height="100%" valign="middle">
<table style="margin:0 auto" cellpadding=0 cellspacing=0>
    <tr>
        <td class="style2">
            Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </td>
        <td class="style3">
    <asp:TextBox ID="txtDate" runat="server"></asp:TextBox><asp:CalendarExtender CssClass="cal_Theme1" ID="CalendarExtender1"
        runat="server" PopupButtonID="txtDate" TargetControlID="txtDate">
    </asp:CalendarExtender>
        </td>
    </tr>
    <tr>
        <td class="style2">
            &nbsp;</td>
        <td class="style3">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style2">
    Reasons:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </td>
        <td class="style3">
    <asp:ListBox ID="txtReasons" runat="server" Width="266px" 
        SelectionMode="Multiple"></asp:ListBox>
        </td>
    </tr>
    <tr>
        <td class="style2">
            &nbsp;</td>
        <td class="style3"><div align=right><br />
            <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">          <center>
                 Send To Batch</center></asp:LinkButton></div></td>
    </tr>
</table>
</td></tr></table>

Irgendwelche Ideen?

Dank,

Jason

InformationsquelleAutor | 2011-06-16

Schreibe einen Kommentar