如何优雅的写分页(伪代码) 一

<s:iterator value="%{recordList}">
id
name
</s:iterator>
页数: ${pageCurrent}/${pageCount}页
每页显示: ${pageSize}
总的记录数: ${recordCount}条
<s:iterator begin="%{beginPageIndex}" end="%{endPageIndex}" var="num">
<a:href="javascript: goPage(${num})"></a>
</s:iterator?>
转到:现在基本上都做成选择的
<select id="pn" οnchange="gotoPage(this.value)">
<s:iterator begin="1" end="${pageCount}" var="${num}">
<option:value="${num}">${num}</option>
</s:iterator>
</select>
<script>
function gotoPage(){
.....
}
</script>
currentPage:当前页
pageCount:总的页数
pageSize:每页显示的记录数
recordCount:总的记录数
recordList:本页的数据列表
beginPageIndex:页面列表的开始索引
endPageIndex:页面列表的结束索引
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
若要在 LaTeX 中使用伪代码分页,可以使用algorithmicx 宏包。以下是一个示例代码: ```latex \usepackage{algorithm} \usepackage{algpseudocode} \begin{algorithm}[htbp] \caption{Algorithm Name} \begin{algorithmic}[1] \Require Input parameters \Ensure Output parameters \Function{FunctionName}{Input parameters} \State statement 1 \State statement 2 \State $\cdots$ \State statement n \EndFunction \end{algorithmic} \end{algorithm} ``` 使用 `algorithm` 环境来创建算法环境,在其中使用 `algorithmic` 环境来编伪代码。`[1]` 选项将行号设置为从 1 开始,而不是默认的 0。使用 `\Require` 和 `\Ensure` 命令来指定输入和输出参数。使用 `\State` 命令来编伪代码中的语句。使用 `\Function` 和 `\EndFunction` 命令来定义函数。 如果伪代码太长,需要分页,则可以使用 `\algstore` 和 `\algrestore` 命令。这两个命令可以将伪代码分成多个部分,每个部分都有自己的页码。以下是一个示例代码: ```latex \usepackage{algorithm} \usepackage{algpseudocode} \begin{algorithm}[htbp] \caption{Algorithm Name} \begin{algorithmic}[1] \Require Input parameters \Ensure Output parameters \Function{FunctionName}{Input parameters} \State statement 1 \State statement 2 \State $\cdots$ \State statement n \algstore{myalg} \end{algorithmic} \end{algorithm} \clearpage \begin{algorithm}[htbp] \begin{algorithmic}[1] \algrestore{myalg} \State statement n+1 \State statement n+2 \State $\cdots$ \State statement m \EndFunction \end{algorithmic} \end{algorithm} ``` 在第一个 `algorithm` 环境中,使用 `\algstore{myalg}` 命令将伪代码保存到一个名称为 `myalg` 的桶中。然后使用 `\clearpage` 命令分页。在第二个 `algorithm` 环境中,使用 `\algrestore{myalg}` 命令从 `myalg` 桶中恢复伪代码。这将在新页面上开始一个新的算法环境。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值