Div高度问题,div在ie和firefox中崩溃了

时间:2012-10-04 06:14:55

标签: html struts2 cross-browser

我的页面中有一个包装div,它有数据行。我没有为这个div设置任何高度,因为它应该改变大小,随着内容的变化。这个div适用于chrome问题是IE和Firefox中的div崩溃了。我注意到,firefox和IE给了div一个特别的高度。但是chrome没有这样的问题。请建议一个解决方案..... 任何帮助表示赞赏....

我正在使用的代码

            <div id="list" class="roundBox" style="">
                <s:bean name="java.util.HashMap" id="qTableLayout">
                    <s:param name="tablecolspan" value="%{8}" />
                </s:bean>
                <table class="list">
                    <s:hidden name="selector"/>
                    <tr>
                        <th >row 1</th>
                        <th >row 2</th>
                        <th >row 3</th>
                        <th >row 4</th>
                        <th >row 5</th>
                        <th class="currency" >row 6</th>
                        <th>row 7</th>
                        <th>row 8</th>
                        <th>&nbsp;</th>
                    </tr>
                    <s:iterator value="logList">
                        <tr>
                            <td><s:property value="channelId"/></td>
                        <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestReceiveTime"/></td>
                        <td><s:date format="MM/dd/yyyy HH:mm:ss" name="processBeginTime"/></td>
                        <td><s:date format="MM/dd/yyyy HH:mm:ss" name="processEndTime"/></td>
                        <td><s:date format="MM/dd/yyyy HH:mm:ss" name="responseAccessTime"/></td>
                        <td class="currency"><s:property value="responseTime"/></td>
                        <td>[<s:property value="responseCode"/>] <s:property value="responseDesc"/></td>

                        <td>

                        <sx:a  
                            href="showchannel?channelId=%{channelId}&token=%{token}" 
                            onclick="javascript:showDropdown('%{token}','show');" executeScripts="true" targets="%{token}channel" 
                            title="View Channel Information" id="%{token}showlink"><img src="images/tree_closed.gif"/></sx:a>
                        <a href=javascript:showDropdown('<s:property value="token"/>','hide'); title="Show/Hide Details" id="<s:property value="token"/>hidelink" style="display:none;"><img src="images/tree_open.gif"/></a>


                        </td>
                        <td>
                        <sx:a 
                            href="audittrailchannel?channelId=%{channelId}&token=%{token}" 
                            onclick="javascript:showauditDropdown('%{token}','show');"
                            executeScripts="true" targets="%{token}auditchannel" title="View Audit Information" 
                            id="%{token}showauditlink"><img src="images/down.png" /></sx:a>
                        <a href=javascript:showauditDropdown('<s:property value="token"/>','hide'); title="Show/Hide Details" id="<s:property value="token"/>hideauditlink" style="display:none;"><img src="images/up.png" /></a>
                        </td>
                        </tr>


                        <tr id="<s:property value="token"/>dropdown" style="display: none">
                            <td colspan="9" valign="top" bgcolor="#a4a4a4">

                                <table class="reports_details" style="width:100%;" align="left" bgcolor="#ffffe2">
                                    <tr><td colspan="3" style="height: 10px">
                                    <sx:div id="%{token}channel">

                                    </sx:div>
                            </td></tr>
                        <tr>

                            <th>Date</th>
                            <th>Description</th>
                            <th></th>
                        </tr>
                        <tr>
                            <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestReceiveTime"/></td>
                        <td>channel request</td>
                        <td><a href="#" onclick="showPopup('<s:property value="token"/>Request')">[View]</a></td>
                        </tr>

                        <tr>
                            <td><s:date format="MM/dd/yyyy HH:mm:ss" name="responseAccessTime"/></td>
                        <td>channel response</td>
                        <td><a href="#" onclick="showPopup('<s:property value="token"/>Response')">[View]</a></td>
                        </tr>


                        <s:iterator value="serverLogList">
                            <tr>
                                <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestTime"/></td>
                            <td><s:property value="requestType"/></td>
                            <td><a href="#" onClick="showPopup('<s:property value="serverLogId"/>ServerLog')">[View]</a></td>
                            </tr>


                        </s:iterator>


                </table></td>

            </tr>
            <tr id="<s:property value="token"/>auditdropdown" style="display: none;">
                <td colspan="9" valign="top" bgcolor="#a4a4a4">
            <sx:div id="%{token}auditchannel" cssStyle="height:100px;overflow:scroll"></sx:div>
            </td>
            </tr>

            </s:iterator>
            <s:if test="logList.size() >= 1">
                <tr>
                    <td class="tdLabel" colspan="9"><center><s:a href ='javascript: submitPrev()' > << Previous </s:a><s:property value="pageIndex"/> of <s:property value="pageCount"/><s:a href ='javascript: submitNext()' > Next >> </s:a></center></td>

                </tr>
            </s:if>
            <s:else>
                <tr><td>No records found</td></tr>
            </s:else>


            </table>

            </div>

1 个答案:

答案 0 :(得分:0)

你在div中放了什么? 在标准html中,即使您的样式具有任何宽度/高度,也不会呈现空div标签。 如果我的答案没有帮助,请告诉我们代码,以便我们可以看到它的错误。