<body>
<table id="large" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#AEC5E0" >
<thead>
<tr>
<th>申请时间</th>
<th>登录帐号</th>
<th> 姓名</th>
</tr>
</thead>
<tbody>
<%
if (companyList != null && companyList.size() > 0) {
for (int i=0;i<companyList.size();i++) {
HashMap companymap = (HashMap) companyList.get(i);
if (companymap.get("add_date") != null) {
add_date = companymap.get("add_date").toString();
}
if (companymap.get("cust_name") != null) {
cust_name = companymap.get("cust_name").toString();
}
if (companymap.get("contact_name") != null) {
contact_name = companymap.get("contact_name").toString();
}
%>
<tr>
<td><%=add_date %></td>
<td><%=user_name1 %></td>
<td><%=contact_name1%></td>
</tr>
</tbody>
<%
}
}
%>
</table></body>
<script type="text/javascript" id="js">
$(document).ready(function() {
$("table").tablesorter();
});
</script>很简单的从数据库取数据,用tablesorter排序,但是通过循环出来的数据排序点了没反应,我改成demo里的死数据可以排序,应该是我做的有问题吧,请教各位大大,教教我如果对循环记录排序,万分感谢!
<table id="large" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#AEC5E0" >
<thead>
<tr>
<th>申请时间</th>
<th>登录帐号</th>
<th> 姓名</th>
</tr>
</thead>
<tbody>
<%
if (companyList != null && companyList.size() > 0) {
for (int i=0;i<companyList.size();i++) {
HashMap companymap = (HashMap) companyList.get(i);
if (companymap.get("add_date") != null) {
add_date = companymap.get("add_date").toString();
}
if (companymap.get("cust_name") != null) {
cust_name = companymap.get("cust_name").toString();
}
if (companymap.get("contact_name") != null) {
contact_name = companymap.get("contact_name").toString();
}
%>
<tr>
<td><%=add_date %></td>
<td><%=user_name1 %></td>
<td><%=contact_name1%></td>
</tr>
</tbody>
<%
}
}
%>
</table></body>
<script type="text/javascript" id="js">
$(document).ready(function() {
$("table").tablesorter();
});
</script>很简单的从数据库取数据,用tablesorter排序,但是通过循环出来的数据排序点了没反应,我改成demo里的死数据可以排序,应该是我做的有问题吧,请教各位大大,教教我如果对循环记录排序,万分感谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货