zoukankan
html css js c++ java
多列分页算法
private
void
ShowRecord(
int
RecordCount,
int
CellCount,
int
CurrentPage)
{
int
CurrentRC,TotalCount,FinalCount,CurrentLocation;
string
ImageName,ImageUrl;
TableRow Tr
=
new
TableRow();
TableCell Tc
=
new
TableCell();
TotalCount
=
RecordInfo.GetRecordCount();
FinalCount
=
TotalCount
/
CellCount
+
1
;
TotalPage
=
(FinalCount
-
1
)
/
RecordCount
+
1
;
CurrentRC
=
FinalCount
-
(CurrentPage
-
1
)
*
RecordCount;
if
(CurrentRC
>
RecordCount) CurrentRC
=
RecordCount;
if
(CurrentPage
>
TotalPage) CurrentPage
=
1
;
for
(
int
i
=
(CurrentPage
-
1
)
*
RecordCount;i
<
CurrentRC
+
(CurrentPage
-
1
)
*
RecordCount;i
++
)
{
Tc.Controls.Add(
new
LiteralControl(
"
<table><tr>
"
));
for
(
int
j
=
1
;j
<=
CellCount;j
++
)
{
CurrentLocation
=
(CurrentPage
-
1
)
*
RecordCount
*
CellCount
+
(i
%
RecordCount)
*
CellCount
+
j;
if
(TotalCount
>=
CurrentLocation)
{
ImageName
=
RecordInfo.GetValue(CurrentLocation
-
1
,
1
);
ImageUrl
=
RecordInfo.GetValue(CurrentLocation
-
1
,
0
);
Tc.Controls.Add(
new
LiteralControl(
"
<td width='120' height='120'><a target='_blank' title='
"
+
ImageName
+
"
' href='
"
+
ImageUrl
+
"
'><img border='0' width='100' height='100' src='
"
+
ImageUrl
+
"
'></a></td>
"
));
}
else
j
=
CellCount
+
1
;
}
Tc.Controls.Add(
new
LiteralControl(
"
</tr></table>
"
));
Tr.Cells.Add(Tc);
pic.Rows.Add(Tr);
}
}
查看全文
相关阅读:
Lua 学习之基础篇一<Lua 运算符>
Git: invalid active developer path
Lua中使用continue 小练习
Xcode 运行objc_msgSend 提示objc_msgsend()Too many arguments to function call, expected 0
逆向思维
机场
旅行者
好图计数
支配树
一般图最大匹配
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
数据中台技术汇(二)| DataSimba系列之数据采集平台
未来科技城 x 奇点云打造「企业数据大脑」,助力1.3万家企业服务
win10 64位安装tensorflow常见问题
利用 cookie 模拟网站登录
URLError 异常处理
设置Headers
urllib.urlretrieve的用法
学校题库多项选择
学校博客的题库
模拟豆瓣登录
热门文章
多线程爬取 threading.Thread 文件名支持gbk编码
用数据库存储的模板
Linux 命令大全
Linux cat与tail 命令
Linux的 文件 和 目录 管理(基本语句)
命令查看memcached中的列表数据
Linux中执行shell脚本的4种方法总结
实施
Mysql数据库百宝箱
Lua 学习之基础篇二<Lua 数据类型以及函数库 汇总>
Copyright © 2011-2022 走看看