我怎么弄都搞不出来横向的滚动条,求大家帮帮忙,帮我看下怎么搞。。<body>
<form action="#" id="dataform" method="post">
<table width="4210" border="0" cellspacing="0" cellpadding="0">
<tr>
   <td height="30" background="${path}/tab/images/tab_05.gif">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
   <td width="12" height="30"><img src="${path}/tab/images/tab_03.gif" width="12" height="30" /></td>
<td>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
     <td width="46%" valign="middle">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%">
<div align="center"><img src="${path}/tab/images/tb.gif" width="16" height="16" /></div>
</td>
<td width="19%" align="left" class="STYLE1"><span class="STYLE3">你当前的位置</span>:[合同台账管理]-[合同台账表]</td>
<td width="15%" align="left" class="STYLE1">开始日期:<input type="text" name="sdate" id="sdate" style="width:138px" value="${sdate}"/></td>
<td width="15%" align="left" class="STYLE1">结束日期:<input type="text" name="edate" id="edate" style="width:138px" value="${edate}"/></td>
<td width="10%"> <input type="button" id="datequery" value="查询" onclick="query();" /></td>
<td width="40%"></td>
</tr>
 </table>
</td>
<td width="54%">
 <table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td onMouseOver="this.style.backgroundImage='url(images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'" width="60">
 <table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="STYLE1">
<div align="center"><img src="${path}/tab/images/22.gif" width="14" height="14" /></div>
</td>
<td class="STYLE1"><div align="center">预览</div></td>
</tr>
 </table>
</td>
<td  onMouseOver="this.style.backgroundImage='url(images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'" width="100">
 <table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="STYLE1">
<div align="center"><img src="${path}/tab/images/22.gif" width="14" height="14" /></div>
</td>
<td class="STYLE1"><div align="center">导出EXCEL</div></td>
</tr>
 </table>
</td>
</tr>
 </table>
</td>
</tr>
 </table>
</td>
<td width="16"><img src="${path}/tab/images/tab_07.gif" width="16" height="30" /></td>
</tr>
 </table>
</td>
</tr>
<tr>
<td>
 <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="${path}/tab/images/tab_12.gif">&nbsp;</td>
<td>
 <table border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="80"  height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">序号</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">报审序号</td>
<td width="250" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同名称</td>
<td width="150" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同类别</td>
<td width="250" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">提供服务单<br/>位/供应商</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同金额<br/>(万元)</td>
<td width="200" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同履行<br/>起止时间</td>
<td width="750" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="5">合同审批</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="2">审批环节</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="2">审批超时</td>
<td width="800" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="6">合同退回情况</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同履<br/>行状态</td>
<td width="80" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">是否事<br/>后合同</td>
<td width="100" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">事后原因</td>
<td width="150" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">合同生<br/>效时间</td>
<td width="300" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="2">合同终结情况</td>
<td width="200" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" colspan="2">指标情况</td>
<td width="400" height="22" style="font-size: 14px" bgcolor="#ECF8FF" align="center" rowspan="3">各审批环节及审<br/>批时间详细说明</td>
</tr>
<tr>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">合同申<br/>报时间</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">场内审<br/>批起始<br/>时间</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">场内审<br/>批结束<br/>时间</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">公司机关<br/>审批起<br/>始时间</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">公司机关<br/>审批结<br/>束时间</td>
<td width="50" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">场内审<br/>批环节</td>
<td width="50" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">公司审<br/>批环节</td>
<td width="50" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">次数<br/>(次)</td>
<td width="50" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">超时情<br/>况描述</td>
<td width="400" height="20" style="font-size: 14px"  bgcolor="#ECF8FF" align="center" colspan="3">场内退回情况</td>
<td width="400" align="center" style="font-size: 14px" bgcolor="#ECF8FF" colspan="3">公司退回情况</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">合同终<br/>结时间</td>
<td width="150" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">合同终<br/>结金额</td>
<td width="100" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">是否属<br/>招标范<br/>围</td>
<td width="100" align="center" style="font-size: 14px" bgcolor="#ECF8FF" rowspan="2">是否进<br/>行招标</td>
</tr>
<tr>
<td width="50" height="30" align="center" style="font-size: 14px" bgcolor="#ECF8FF" >次数(次)</td>
<td width="325" align="center" style="font-size: 14px"  bgcolor="#ECF8FF">原因描述</td>
<td width="50" align="center" style="font-size: 14px"  bgcolor="#ECF8FF">处罚认定次数</td>
<td width="50" height="30" align="center" style="font-size: 14px"   bgcolor="#ECF8FF" >次数(次)</td>
<td width="325" align="center" style="font-size: 14px"  bgcolor="#ECF8FF">原因描述</td>
<td width="50" align="center" style="font-size: 14px"  bgcolor="#ECF8FF">处罚认定次数</td>
</tr>
<s:iterator value="#request.list" var="compactdetail">
<tr>
<td height="25" bgcolor="#FFFFFF" class="STYLE1" align="center""><s:property value="#compactdetail.rowNum"/></td>
<td  bgcolor="#FFFFFF" class="STYLE1" align="center"><s:property value="#compactdetail.applyId"/></td>
<td  bgcolor="#FFFFFF" class="STYLE1" align="center"><s:property value="#compactdetail.compactName"/></td>
<td  bgcolor="#FFFFFF" class="STYLE1" align="center"><s:property value="#compactdetail.compactType"/></td>
<td  bgcolor="#FFFFFF" class="STYLE1" align="center"><s:property value="#compactdetail.compactSupplier"/></td>...省略
</tr>
</s:iterator>
 </table>
</td>
<td width="8" background="${path}/tab/images/tab_15.gif">&nbsp;</td>
</tr>
 </table>
</td>
</tr>
<tr>
<td height="35" background="${path}/tab/images/tab_19.gif">
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="35"><img src="${path}/tab/images/tab_18.gif" width="12" height="35" /></td>
<td class="STYLE4">
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%" >共 
<span class="right-text09">${pager.totalPages}</span> 页 | 第 
<span class="right-text09">${pager.currentPage}</span> 页&nbsp;&nbsp;[
<a href="#" onclick="javascript:first()" class="right-font08">首页</a> | 
<a href="#" onclick="javascript:previous()" class="right-font08">上一页</a> | 
<a href="#" onclick="javascript:next()" class="right-font08">下一页</a> | 
<a href="#" onclick="javascript:last()" class="right-font08">末页</a>] 转至:
</td>
<td width="88%" align="left">
<select name="select1" id="select1" onchange="gotoPage();">
<c:forEach var="i" begin="1" end="${pager.totalPages}" step="1">
<c:choose>
<c:when test="${i == pager.currentPage}">
<option selected="selected" value="${i}">
${i}
</option>
</c:when>
<c:otherwise>
<option value="${i}">
${i}
</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>&nbsp;&nbsp;页
</td>
</tr>
 </table>
</td>
<td width="16"><img src="${path}/tab/images/tab_20.gif" width="16" height="35" /></td>
</tr>
 </table>
</td>
</tr>
</table>
</form>
</body>谢谢滚动条

解决方案 »

  1.   

    把form嵌套在一个div中,想下面这样
    <div style="width: 800px;height: auto;overflow: scroll">
       <form action="#" id="dataform" method="post">
          .
          .
          .
        </form>
    </div>
    width的大小根据你的需要设置
      

  2.   


    这个页面单独打开是有滚动条的,但是从主页面用iframe嵌入的时候就没有了,我在iframe里有scrolling="yes" 属性的
      

  3.   


    这个页面单独打开是有滚动条的,但是从主页面用iframe嵌入的时候就没有了,我在iframe里有scrolling="yes" 属性的
    在子页面设置body 的宽度,当body的宽度超过了iframe的宽度才会出现水平滚动条
      

  4.   


    这个页面单独打开是有滚动条的,但是从主页面用iframe嵌入的时候就没有了,我在iframe里有scrolling="yes" 属性的
    在子页面设置body 的宽度,当body的宽度超过了iframe的宽度才会出现水平滚动条子页面的body里的table宽度有4000+,主页面的iframe宽度是100%。
    我刚才把iframe的宽度设置成200,子页面都变成很窄了,但是滚动条就是没出现
    我试了很多方法,一直没出现,一直都是只能用鼠标中键左右滚动。浏览器是IE8
      

  5.   


    这个页面单独打开是有滚动条的,但是从主页面用iframe嵌入的时候就没有了,我在iframe里有scrolling="yes" 属性的
    在子页面设置body 的宽度,当body的宽度超过了iframe的宽度才会出现水平滚动条子页面的body里的table宽度有4000+,主页面的iframe宽度是100%。
    我刚才把iframe的宽度设置成200,子页面都变成很窄了,但是滚动条就是没出现
    我试了很多方法,一直没出现,一直都是只能用鼠标中键左右滚动。浏览器是IE8
    我刚试了下,上面给你的方法在Firefox是会有横向滚动条的,在IE中没有,在IE中药想有横向滚动条需要用个div把元素包裹起来,然后设置div的宽度!只要div的宽度大于iframe宽度,iframe就会出现横向滚动条,我在IE8中通过了!
      

  6.   


    我的iframe是这样
    <td width="100%" align="center">
        <iframe name="rightFrame" id="rightFrame" scrolling="yes" width="100%" frameborder="0" src="${pageContext.request.contextPath}/compactCountAction!getCompactCountView"></iframe>
    </td>
    子页面在body下面加了个div标签把整个页面包进去了
    <div style="width:4210px;">
    ...
    </div>
    还是没有我崩溃,我不知道怎么办了
      

  7.   

    你别把width="100%"设置为100%呀!,使用个固定的数值!