在jsp中怎么实现 数据库读出来的记录在页面上分两列显示 如
1 忍忍忍 2 让让让
3 太太太 4 我我我
5 数数数 6 出出出
7 记记记 8 页页页
上页 下页asp上 有个next 用个循环就可以了 java的logic:iterate 怎么弄呢~~~
高手们指点下哦
1 忍忍忍 2 让让让
3 太太太 4 我我我
5 数数数 6 出出出
7 记记记 8 页页页
上页 下页asp上 有个next 用个循环就可以了 java的logic:iterate 怎么弄呢~~~
高手们指点下哦
解决方案 »
- 请问ext中ajax 同步访问问题
- 为什么同样的语句前几句没错,后两句就有错误?急!!!!!!!!!!
- jsp网页用xhtml的问题?
- 大虾求救,servlet低级问题!新手上
- jsp请求,对应的servlet接受不到,web.xml文件配置也没有发现问题,请求帮助!!
- struts2配置中的action name的问题。
- 关于Struct2跳转的问题,求救各位大大
- 关于.properties文件
- 使用tomcat4.06连接mysql数据库(linux 8.0下),老师出现这个问题,大家来看看
- 关于html中select的问题,送分了
- JBuilder的工程导入到eclipse 编译后出现乱码
- 一个jsp往数据库中插数据的乱码的问题
<table width="100%" >
<tr>
<td colspan="4"></td>
<c:forEach var="item" items="${query_list}" varStatus="status">
<c:if test="${status.index%2==0}">
</tr>
<tr id="tr_terminal${status.index/2}" class="biao-bg" style="display:">
</c:if>
<td width="25%" style="font-size:11px;display:;" valign="top" >
<DIV title="${item.param_code}" STYLE="width: 160px; overflow: hidden; text-overflow:ellipsis">
<NOBR>
<c:if test="${rssForm.rssInfo.cbx==1}">
<input type="checkbox" id="cb_${item.param_code}" name="cb_weather" ${item.bool==true?"checked":""} value="${item.param_code}">
</c:if>
<c:if test="${rssForm.rssInfo.cbx==0}">
<input type="checkbox" id="cb_${item.param_code}" name="cb_weather" disabled value="${item.param_code}">
</c:if>
[${item.param_code}]${item.param_name}
</NOBR>
</DIV>
</td>
<c:if test="${status.last}">
<c:forEach var="i" begin="${status.index+1}" end="${2-(status.index)%4+status.index-1}">
<td width="25%"> </td>
</c:forEach>
</c:if>
</c:forEach>
</tr></table>
li{float:left;}
</style>
<div style="width:200px;">
<ul>
<%--loop--%>
<logic:iterator>
<li></li>
</logic:iterator>
</ul>
</div>
调整div的宽度,就可以调整一行显示的数量。
if(i%2==0){
<tr>
}
<td>
</td>
if(i%2==1){
</tr>
}
<%for(int i=0;i<objs.length;i++){%>
<%if(i%2=0){out.print("<tr>");}%> //这里控制 两列才换一行;<td><%=i%> <%=objs[i]%></td><%if(i%2=1){out.print("</tr>");}%> //这里控制 两列才换一行;
<%}%>
</table>logic:iterate 与for循环 类似
<logic:iterate indexId="index" id="Item" name="objs" >
<%for(int i=0;i<objs.length;i++){%>iterate 中的 index 相当于 for 中的 i
iterate 中的 Item 相当于 for 中的 objs[i]
<for:Each/>是jstl里面的标签.你得导入jstl