今天碰到一个很棘手的问题,jsp页面所在的框架的大小已经固定了,我在页面上写了一个table,table有多少列不固定,但是每一列的宽度我设定了,是希望当各个列的宽度加在一起超过屏幕宽度时自动出现滚动条,但是我发现一点作用都没有,列数过多时页面被挤变形非常难看,想向大虾们请教,如何出现滚条且页面不变形我的Jsp如下<body style="margin:0px">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<div style="width:800px; overflow-x:auto">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<%
Vector listDate=(Vector)request.getAttribute("listDate");
if(listDate!=null&&listDate.size()>0){
for(int i=0;i<listDate.size();i++){
Hashtable ht=(Hashtable)listDate.get(i);
%>
<th class="rpm_1 " width="200px"><%=ht.get("date")%></th>
<% }}%>
</tr>
</table>
</div>
</td></tr>
</table>
</body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<div style="width:800px; overflow-x:auto">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<%
Vector listDate=(Vector)request.getAttribute("listDate");
if(listDate!=null&&listDate.size()>0){
for(int i=0;i<listDate.size();i++){
Hashtable ht=(Hashtable)listDate.get(i);
%>
<th class="rpm_1 " width="200px"><%=ht.get("date")%></th>
<% }}%>
</tr>
</table>
</div>
</td></tr>
</table>
</body>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货