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);
}
}
查看全文
相关阅读:
idea资源导出失败的问题
计算机的运算方法
ajax返回json字符串,前端显示中文乱码问题解决
解决xml编码问题:1 字节的 UTF8 序列的字节 1 无效
【转】erlang四种监控策略one_for_one、one_for_all、simple_one_for_one、rest_for_one
erlang:register and global:register_name
【转】重点介绍erlang的global模块
memset函数用法
简单实现SQL Server 2012高可用性组
《mysql必知必会》读书笔记游标的使用
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
Android基础(二) 文件的读写及数据存储
Android基础(八) Activity的启动模式 内存管理
Android基础(五) ContentProvider 内容提供者
Android基础(六) Activity
Android基础(三) 数据库SQLite
[转载]如何管理你的线程池(Executor)
Android基础(九) BroadcastReceiver 广播接收者
Android基础(一) 电话、短信
Android基础(七) Activity的生命周期
Android基础(四) ListView的使用
热门文章
我的linux学习日记day6
我的linux学习日记day5
我的linux学习日记day3
我的linux学习日记day4
我的linux学习日记day7
我的linux学习日记day2
我的linux学习日记day1
MySQL存储过程
win10系统通过命令禁用/启用笔记本自带键盘的有效方法
计算机网络
Copyright © 2011-2022 走看看