?? htmlutils.java
字號:
package com.core;
public class HtmlUtils {
/**
* spage :顯示總頁數(shù) npage :顯示當(dāng)頁數(shù) bpage :顯示前一頁 lpage :顯示后一頁
*
* @param step
* :步長
* @param row
* :總記錄數(shù)
* @param page
* :當(dāng)前頁數(shù)
* @return
*/
public static String table(int step, int row, int page, String http,
String target) {
int spage = 0, npage = 0, t = 0, bpage = 0, lpage = 0;
t = row % step;
if (t == 0) {
spage = row / step;
} else {
spage = row / step + 1;
}
if (page <= 1) {
npage = 1;
bpage = 1;
lpage = 2;
} else if (page >= spage) {
npage = spage;
bpage = spage - 1;
lpage = spage;
} else {
npage = page;
bpage = page - 1;
lpage = page + 1;
}
String str = "<table width=100% border=0 cellpadding=0 cellspacing=0 style='font-size:10pt;' bgcolor=#EEFAFF><tr align=center>";
str += "<td width=120>共" + row + "條記錄</td><td width=120>第" + npage
+ "/" + spage + "頁</td>";
str += "<td width=160><a target='" + target + "' href='" + http
+ "?page=" + 1 + "'>|<</a> <a target='" + target
+ "' href='" + http + "?page=" + bpage
+ "'><<</a> <a target='" + target + "' href='"
+ http + "?page=" + lpage
+ "'>>></a> <a target='" + target + "' href='"
+ http + "?page=" + spage
+ "'>>|</a></td><form method=post action='" + http + "'>";
str += "<td width=160><input type=text name=page size=3 maxlength=10 style='font-size:9pt; border: 1px solid #999999;' align=center>";
str += "<input type=submit style='font-size:9pt; border:1 solid #999999; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal' value='Go' ></td></form></tr></table>";
return str;
}
public static String table(int row, int page, String http) {
return table(FinalConstants.STEP, row, page, http, "_self");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -