Quando le mie tabelle vengono caricate con i dati, le tabelle di sinistra occupano l'intero schermo e le tabelle di destra vengono smoosh

StackOverflow https://stackoverflow.com/questions/1635439

  •  06-07-2019
  •  | 
  •  

Domanda

Ho avuto questo problema piuttosto frustrante, e avendo fallito così tante volte, spero che qualcuno qui possa aiutarmi. Quello che succede è che queste tabelle sul lato sinistro della pagina appaiono bene e fanno quello che dovrebbero fare quando compilo . Tuttavia, una volta caricato sull'intranet della mia azienda e caricato i dati in quel modo (stessi dati tra l'altro), le tabelle a sinistra della pagina esplodono attraverso lo schermo oltre la risoluzione del mio laptop di lavoro (1600x900) mentre le tabelle a destra si restringono a circa 1/4 della loro dimensione.

Quindi, per favore aiutatemi, questo mi ha frustrato per ore. Di seguito troverai la pagina aspx e il foglio di stile. Pubblicherò solo i primi due pannelli di tabelle.

ShippingReference.aspx

<table style="width: 1000px;">
        <tr style="height: 800px;">
            <td style="width: 50%; height: 100%;" valign="top">
                <asp:Panel runat="server" ID="pnlMainInfo" style="margin:20px; background-color:#ccccff" GroupingText="Main Information:">
                    <table style="width:100%; height:100%;">

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Terms:</h2> </div>
                                    <asp:TextBox ID="txtTerms" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Acceptable Carriers:</h2> </div>
                                    <asp:TextBox ID="txtCarriers" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Routing/Order Submit Time Line:</h2> </div>
                                    <asp:TextBox ID="txtTimeLine" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Appointment Information Required:</h2> </div>
                                    <asp:TextBox ID="txtAppointmentInformation" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                             <td style="width: 25%;">
                                 <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Carton Markings Required:</h2> </div>
                                    <asp:TextBox ID="txtCartonMarkings" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Special Labels Required:</h2> </div>
                                    <asp:TextBox ID="txtSpecialLabels" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                         <tr align="center">
                            <td style="width: 25%;">
                                 <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Shipping Contacts:</h2> </div>
                                    <asp:TextBox ID="txtShippingContacts" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Routing Website:</h2> </div>
                                    <asp:TextBox ID="txtRoutingWebsite" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Customer Website Instructions/Trouble Shooting:</h2> </div>
                                    <asp:TextBox ID="txtCustWebsite" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                    </table>
                </asp:Panel>

                <cc1:CollapsiblePanelExtender ID="pnlMainInfo_CollapsiblePanelExtender" 
                    runat="server" Enabled="True" TargetControlID="pnlMainInfo">
                </cc1:CollapsiblePanelExtender>
            </td>

            <td style="width: 50%; height: 100%;" valign="top">
                <asp:Panel runat="server" ID="pnlEDI"  style="text-align:center; margin:20px; background-color:#ccccff" GroupingText="EDI:">
                    <table style="width:100%; height:100%;">

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Contact for Missed Pickup by Carrier:</h2> </div>
                                    <asp:TextBox ID="txtMissedPickupContact" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Plant EDI Documents Required:</h2> </div>
                                    <asp:TextBox ID="txtPlantEDI" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>DI EDI Documents Required:</h2> </div>
                                    <asp:TextBox ID="txtDirectImportEDI" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                         <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Import/Direct Import ISF Requirements:</h2> </div>
                                    <asp:TextBox ID="txtISFRequirements" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                 <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Import/Direct Import Customer Broker/Notify Party:</h2> </div>
                                    <asp:TextBox ID="txtCustomerBroker" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                        <tr align="center">
                            <td style="width: 25%;">
                                <div class="TBox" style="width: 90%; height: 100%;">
                                    <div class="header"> <h2>Other Shipping Documents Required:</h2> </div>
                                    <asp:TextBox ID="txtOtherShippingDocuments" runat="server" TextMode="MultiLine" Rows="5" MaxLength="500" Width="93%" CssClass="text" />
                                </div>
                            </td>
                        </tr>

                    </table>    
                </asp:Panel>
            </td>
        </tr>

Foglio di stile:

body { text-align:center; }

.lblErrorMessage    { font-family: Tahoma; font-size: 9pt; color: red; }

.TBox {
    color:#333333;
    font-size:11px;

    background: url('../../Images/box_bottom_right.gif') no-repeat bottom right;
    margin: 0;
    padding:0;
    font-family:Verdana, Arial, Helvetica, sans-serif;
}

.TBox .header {
    margin: 0;
    padding: 0;
    background: url('../../Images/box_top_right.png') no-repeat top right;
    text-align: center;
}

.TBox .header h2 {
    color:#ffffff;

    background: url('../../Images/box_top_left.png') no-repeat top left;
    font-size:14px;
    padding-top: 7px;
    height:20px;
    margin: 0;
}

.TBox .text {

    background: url('../../Images/box_bottom_left.gif') no-repeat bottom left;
    padding:10px 10px 15px 10px;    
    margin:0;
    height:auto;
    text-align:justify;
    color:#003399;
    line-height:15px;
}
È stato utile?

Soluzione

Prova a ripulire prima un po 'la pagina, quindi dovrebbe essere più facile " debug " ;:

  • Posiziona tutto lo stile nel foglio di stile, in particolare gli attributi ripetuti width.
  • Rimuovi i tag non necessari / ridondanti, ovvero lo stile definito con <div class="header"> deve essere impostato sul <h2> tag

Mi rendo conto che questa non è la risposta che stai cercando, ma dovrebbe sicuramente aiutarti a capire il problema. O almeno rendere il tuo codice di esempio più facile da leggere - per tutti gli altri. :)

Altri suggerimenti

Ahhh .... Cambia le tabelle in DIV ...

Ho controllato il tuo codice in IE, Chrome, Mozilla. Per me sembra funzionare correttamente. La risoluzione dello schermo del mio sistema è 1280 * 800. Better U crea un div principale. Fai la sua larghezza: 100%. Quindi crea due tabelle all'interno di quella div. Ogni larghezza: 50%. Non usare troppi attributi di larghezza.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top