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);
}
}
查看全文
相关阅读:
Nginx服务器环境搭建
PostgreSQL常见问题处理方法
Linux之awk使用
PostgreSQL常用SQL
用apache commons-pool2建立thrift连接池
redis开发小结
如何解决netty发送消息截断问题
后端服务开发总结
利用git reflog找回错误的重置
TCP长链接调试利器nc
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
实对称矩阵的正定性、负定性、半定性和不定性
测试公式
【Java】String、StringBuilder和StringBuffer
【leetcode】1335. 工作计划的最低难度
【leetcode】5343. 多次求和构造目标数组
【Spring Cloud】微服务架构选型方案
【Dubbo】Zookeeper+Dubbo项目demo搭建
【Spring Cloud(二)】服务注册与发现组件Eureka
【Spring Cloud(一)】微服务架构体系及组件介绍
【Spring Cloud】实战项目搭建
热门文章
【Spring Cloud(四)】服务熔断降级机制——Hystrix
IOC和DI之刨根问底 -- 第一节
安装asp.net core环境命
ireport 导出excel 分页 和 文本转数字格式的解决方法
JS中this的四种用法
vim 安装vundle 之curl
ubuntu 14.04 64bit 安装 oracle 11g r2
mysql 乱码问题的捣鼓
有关satement与preparedstatement
JDBC连接mysql
Copyright © 2011-2022 走看看