分类:
2008-09-09 17:22:59
public static final String splitPages2(int thePage, String queryString, int count,
int pageLength)
{
int maxPage = count / pageLength + 1;
int prevPage = thePage - 1;
if (prevPage < 1)
{
prevPage = 1;
}
int nextPage = thePage + 1;
int showMaxPage = thePage + 6;
int spacePage = 1;
if (thePage > 6)
{
spacePage = thePage - 5;
}
if (showMaxPage < 10)
{
showMaxPage = 10;
}
//
StringBuffer sb = new StringBuffer();
sb.append("
第一页");
sb.append("
+ "\">上一页
for (int i = spacePage; i < showMaxPage && i <= maxPage; i++)
{
String fontColor = "black";
if (i == thePage)
{
fontColor = "red";
}
sb.append("
+ "\">" + addzero(i, 2) + "
}
[1]