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);
}
}
查看全文
相关阅读:
用flask实现的分页
用flask的扩展实现的简单的页面登录
基于DBUtils实现数据库连接池
Flask基础
Flask入门
发消息示例
反向找related_name以及limit_fields_to
对于stark(curd)插件的使用简单介绍
列表的append方法和extend方法
函数和方法的区别
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
Android -- SurfaceView绘制
Android -- Messenger与Service
Android -- 使用主题配置文件,去掉程序启动界面的短暂黑屏
内存管理
Android -- 经验分享(三)
Android -- 再来一发Intent
Android -- 再来一发Json
PHP curl 抓取AJAX异步内容
java笔试题(5)
平衡二叉树
热门文章
通俗的理解HTTPS以及SSL中的证书验证
WINDOWS操作系统中可以允许最大的线程数
使用任务Task 简化异步编程
C#多线程之 ManualResetEvent和AutoResetEvent
Mysql 监视工具
zabbix 介绍
线程安全的补充
浏览器的时间线流程定义
理解并使用.NET 4.5中的HttpClient(转)
【asp.net Core 2.0 初步探索】
Copyright © 2011-2022 走看看