首页 > 其他分享 >每日总结-23.4.12

每日总结-23.4.12

时间:2023-04-12 14:24:28浏览次数:37  
标签:总结 box 12 num pageSize 23.4 tempStr var border

<%@ page import="zhengcechaxun.Pd_zhengce" %>
<%@ page import="zhengcechaxun.Thesql" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"

         pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta charset="utf-8" />
    <title>科技政策查询系统</title>
    <style type="text/css">
        table {
            border-collapse: collapse;
            border-spacing: 0;
        }
        .cloudTableAuto{
            width:1200px;
            margin:20px auto;
        }
        .cloudTable{
            border: 1px solid #e0e6ed;
            font-size: 16px;
            width:100%;
        }
        .cloudTableTitle{
            padding:10px 20px;
        }
        .cloudTable td {
            height: 40px;
            min-width: 0px;
            box-sizing: border-box;
            vertical-align: middle;
            position: relative;
            border-bottom: 1px solid #e0e6ed;
        }
        /*  表头 */
        .cloudTable_header tr {
            background-color: #efeff1;
        }
        .cloudTable_header th {
            min-width: 0;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
            border-bottom: 1px solid #e0e6ed;
            border-right: 1px solid #e0e6ed;
            padding: 10px 0px;
            white-space: nowrap;
            overflow: hidden;
            font-weight: bold;
            text-align:center;
        }

        /* 表身体 */
        .cloudTable_body tr td {
            height: 40px;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
        }
        .cloudTable_body tr td {
            box-sizing: border-box;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
            border-right: 1px solid #e0e6ed;
        }
        .cloudMtxTable_body{
            /*height:102px;*/
            height:402px;
            width:100%;
            overflow-y: auto;
            border-bottom: 1px solid #e0e6ed;
        }

        /* 公用样式 */
        .data-cell {
            padding-left: 15px;
            padding-right: 15px;
            font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
        }
        .cloudTable_body tr:hover {
            background-color: #c5e8fe;
        }

    </style>
</head>
<%
    String name=request.getParameter("name");
    String document=request.getParameter("document");
    String organ=request.getParameter("organ");
    int len;
    Pd_zhengce[] pddsall=null;
    Thesql thesql;
    if(name==null){name="";}
    if(document==null){document="";}
    if(organ==null){organ="";}

    thesql=new Thesql();
    pddsall=thesql.policy_DimQuery(name,document,organ);
    len= pddsall.length;


%>
<body onl oad="goPage(1,10);">
<div class="cloudTableAuto">
    <!-- 第一个table -->
    <table class="cloudTable cloudMtxTableHead">
        <colgroup>
            <col width="230px">
            <col width="220px">
            <col width="60px">
            <col width="90px">
            <col width="90px">
        </colgroup>
        <thead class="cloudTable_header">
        <tr>
            <th>政策名称</th>
            <th>发文机构</th>
            <th>颁布日期</th>
            <th>政策分类</th>
            <th>操作</th>
        </tr>
        </thead>
    </table >
    <div class="cloudMtxTable_body" >
        <table style="table-layout:fixed;border: 1px solid #e0e6ed;font-size: 16px;width:100%;" id="idData" >
            <colgroup >
                <col width="230px">
                <col width="220px">
                <col width="60px">
                <col width="90px">
                <col width="90px">
            </colgroup>
            <tbody class="cloudTable_body ">
        <%
            for(int i=0;i<len;i++)
            {
        %>
            <tr>
                <td class="data-cell" ><%out.print(pddsall[i].name); %></td>
                <td class="data-cell" ><%out.print(pddsall[i].organ); %></td>
                <td ><%out.print(pddsall[i].pubdata); %></td>
                <td ><%out.print(pddsall[i].type); %></td>
                <td ><a href="">查看</a></td>
            </tr>
        <%}%>
        </table>
    </div>
    <div class="cloudTableAuto" >

        <table width="60%" align="center" >
            <tr><td style="font-size:14px;"><div id="barcon" name="barcon"></div></td></tr>
        </table>
        <script type="text/javascript">
            /**
             * 分页函数
             * pno--页数
             * psize--每页显示记录数
             * 分页部分是从真实数据行开始,因而存在加减某个常数,以确定真正的记录数
             * 纯js分页实质是数据行全部加载,通过是否显示属性完成分页功能
             **/
            function goPage(pno,psize){
                var itable = document.getElementById("idData");
                var num = itable.rows.length;//表格所有行数(所有记录数)
                console.log(num);
                var totalPage = 0;//总页数
                var pageSize = psize;//每页显示行数
                //总共分几页
                if(num/pageSize > parseInt(num/pageSize)){
                    totalPage=parseInt(num/pageSize)+1;
                }else{
                    totalPage=parseInt(num/pageSize);
                }
                var currentPage = pno;//当前页数
                var startRow = (currentPage - 1) * pageSize+1;//开始显示的行  31
                var endRow = currentPage * pageSize;//结束显示的行   40
                endRow = (endRow > num)? num : endRow;    40
                console.log(endRow);
                //遍历显示数据实现分页
                for(var i=1;i<(num+1);i++){
                    var irow = itable.rows[i-1];
                    if(i>=startRow && i<=endRow){
                         irow.style.display = "block";
                         irow.cells[0].style.width="290px";
                         irow.cells[1].style.width="220px";
                         irow.cells[2].style.width="60px";
                         irow.cells[3].style.width="90px";
                         irow.cells[4].style.width="90px";
                    }else{
                        irow.style.display = "none";
                    }
                }
                var pageEnd = document.getElementById("pageEnd");
                var tempStr = "共"+num+"条记录 分"+totalPage+"页 当前第"+currentPage+"页";
                if(currentPage>1){
                    tempStr += "<a href=\"#\" onClick=\"goPage("+(1)+","+psize+")\">首页</a>";
                    tempStr += "<a href=\"#\" onClick=\"goPage("+(currentPage-1)+","+psize+")\"><上一页</a>"
                }else{
                    tempStr += "首页";
                    tempStr += "<上一页";
                }

                if(currentPage<totalPage){
                    tempStr += "<a href=\"#\" onClick=\"goPage("+(currentPage+1)+","+psize+")\">下一页></a>";
                    tempStr += "<a href=\"#\" onClick=\"goPage("+(totalPage)+","+psize+")\">尾页</a>";
                }else{
                    tempStr += "下一页>";
                    tempStr += "尾页";
                }

                document.getElementById("barcon").innerHTML = tempStr;

            }
        </script>
    </div>
</div>
</body>
</html>

 

标签:总结,box,12,num,pageSize,23.4,tempStr,var,border
From: https://www.cnblogs.com/laobing6214/p/17309628.html

相关文章

  • 2023.4.12——软件工程站立会议
    团队照片:站立会议内容:昨天做了什么?完成了团队第一阶段会议;今天要做什么?准备开始写具体代码实现;遇到什么问题?团队会议纪实和博客整理;......
  • 火山引擎数智平台协助洞察美图类 APP 新增长 付费用户转化超过 124%
     更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群美图类APP的下一个增长点在哪里?目前,国内市场上的美图类APP大多都遵循着基础功能免费使用、个性化热门功能收费使用的原则。即用户可以在APP内选择基础的免费修图功能,比如「瘦脸瘦身」、......
  • UVa 11129 An antiarithmetic permutation (构造题&想法题&分治)
    11129-AnantiarithmeticpermutationTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=2070Apermutationof n+1 isabijectivefunctionoftheinitial n+1......
  • UVa 10112 Myacm Triangles (枚举&计算几何)
    10112-MyacmTrianglesTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=101&page=show_problem&problem=1053TherehasbeenconsiderablearcheologicalworkontheancientMyacmculture......
  • UVa 112 Tree Summing (scanf()去空格&递归&二叉树遍历)
    112-TreeSummingTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=48BackgroundLISPwasoneoftheearliesthigh-levelprogramminglanguagesand,withFORTRAN,isoneoft......
  • R语言中的matrix(矩阵),list(列表),data.frame(数据框)总结
    一、R语言中的矩阵matrix是一个二维的数组array,因此数组array的一些操作它也适用。①它与array相比,特有的是矩阵的一些运算,例如:求维度:dim(A)转置:t(A)求行列式:det(A)矩阵相乘:x%*%y对角运算:diag(A)求逆:solve(A,b)求特征值和特征向量:eigen(A)奇异值分解:svd(A)②在多维数组中,apply函数......
  • 4.12趣味百题第四题
    一问题描述     一辆卡车违反交通规则,撞人后逃跑。现场有三人目击该事件,但都没有记住车号。只几下车号的特征。1.牌照前两位数字相同。2.后两位数字相同且不同于前两位数字。3.这四位数刚好是一个整数的平方。二设计思路1.前两位数字0<=a=b<=9;2.后两位数字0<=c=d<......
  • 【230412-1】已知:f(2x+1)=4x^2-6x+5 求:f(3) 三种方法做一初中函数题
    ......
  • 0412
    上节课回顾IEDA护眼绿C7EDCC大的面向对象小的面向过程面向对象三大特征(4)1.封装2.继承3.多态(4.抽象)1.同一个类中成员函数可以直接访问其他成员(包含成员变量,成员函数,)2.类与类之间的访问方式:1.需要创建对象语法格式:类名对象名=new类名();Datedate=newDat......
  • 数学建模经验分享与总结(吐血整理)
    一、前言首先说明一件事情就是数学建模比赛想拿奖没有捷径,but过来人的经验是非常有必要参考的。 在数模竞赛中经验会告诉我们该怎么选题,怎么安排时间,怎么控制进度,知道什么是最重要的,该怎么写论文......,或许有人会认为选题也需要经验吗?经过参加了多次比赛后觉的是有技巧的,选......