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);
}
}
查看全文
相关阅读:
函数的逻辑读成零
SQL逻辑读变成零
体系结构中共享池研究
执行计划基础 动态采样
执行计划基础 统计信息
识别低效率的SQL语句
oracle 知识
XPATH 带命名空间数据的读取
ACTIVITI 研究代码 之 模版模式
ACTIVITI 源码研究之命令模式执行
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
内联标签的特殊之处
box-sizing与calc()与flex
$routeParams传递路由参数
路由
控制器与模型
1021. Deepest Root (25)——DFS+并查集
题目1534:数组中第K小的数字 ——二分
VS下QT的自定义槽函数修改方法
最长的回文串——hdu3068
题目1527:首尾相连数组的最大子数组和
热门文章
随时查找中位数——pat1057
[Swift]LeetCode1144. 递减元素使数组呈锯齿状 | Decrease Elements To Make Array Zigzag
[Swift]LeetCode1145. 二叉树着色游戏 | Binary Tree Coloring Game
[Java]LeetCode1114. 按序打印 | Print in Order
[Java]LeetCode1115. 交替打印FooBar | Print FooBar Alternately
[Java]LeetCode1116. 打印零与奇偶数 | Print Zero Even Odd
[Java]LeetCode1117. H2O 生成 | Building H2O
[Swift]LeetCode1140. 石子游戏 II | Stone Game II
[Swift]LeetCode1139. 最大的以 1 为边界的正方形 | Largest 1-Bordered Square
[Swift]LeetCode1138. 字母板上的路径 | Alphabet Board Path
Copyright © 2011-2022 走看看