|
1.将光标移在第一行第一列中,切换到代码中加入:<%=(PageNo-1)*RPP+I%>
这个代码是显示序号用的。
2.右边2个单元格(当然你自己可以根据需要分更多的列)就是为你要显示的记录了。请分别从绑定的记录集中选中你要显示的字段拖放在相应的单元格中,(也可以选中后再点右下角的“插入”按钮)。这里我们就先拖2个进来如“编号”和“公司名称”。分别到1行第2个单元格和1行第3个单元格中。
3.这个是个关键的,请将光标移到第一行任意单元格中,再来点选窗口底下的<tr>,这时你看看代码,<tr>....</tr>就被选中了。这时请在<tr>....</tr>的前面插入如下代码:
<% If Recordset1.EOF OR Recordset1.BOF Then Else For I=1 To RPP %>再在<tr>....</tr>之后插入如下代码: <% Recordset1.MoveNext If Recordset1.EOF OR Recordset1.BOF Then Exit For Next End If %> |
4.这是就完成表格的第一行的工作。下来也是关键,即分页的连接。光标在第2行第一个单元格中时在代码窗口插入:
<% showPageInfo Recordset1.PageCount,PageNo %> 的代码。右边的2个单元格将其合并,在代码中插入:
<% showPageNavi Recordset1.PageCount,PageNo %> 的代码。
5.大功告成!这时感快预览一下吧。。。。
表格的全部代码如下:
<table width="710" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#333333"> <% If Recordset1.EOF OR Recordset1.BOF Then Else For I=1 To RPP %> <tr bgcolor="#FFFFFF"> <td width="30" align="center"><%=(PageNo-1)*RPP+I%></td> <td><%=(Recordset1.Fields.Item("编号").Value)%></td> <td><%=(Recordset1.Fields.Item("公司名称").Value)%></td> </tr> <% Recordset1.MoveNext If Recordset1.EOF OR Recordset1.BOF Then Exit For Next End If %> <tr bgcolor="#FFFFFF"> <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr bgcolor="#006699" class="w12"> <td width="121" align="center"><% showPageInfo Recordset1.PageCount,PageNo %> </td> <td width="573" align="center"> <% showPageNavi Recordset1.PageCount,PageNo %> </td> </tr> </table></td> </tr> </table> |
上一页 [1] [2] [3] 下一页 |