zoukankan      html  css  js  c++  java
  • 分页表

    <?php 
    
        //引入model类
        include './Model.php';
        //实例化对象
        $mod = new Model('user');
    
        //获取总数据
        $count = $mod->count();
    
        //引入page类
        include './Page.php';
    
        $page = new Page($count,5);
    
        $limit = $page->getLimit();
    
        $show = $page->show();
    
        $res = $mod->limit($limit)->select();
        //echo '<pre>';
        ///var_dump($res);
    
    
    
     ?>
     <!DOCTYPE html>
     <html lang="en">
     <head>
         <meta charset="UTF-8">
         <title>Document</title>
         <style type="text/css">
        table{
            width:400px;
            height:300px;
            border:solid 1px blue;
            border-collapse:collapse;
        }
    
        table td{
    
            text-align:center;
        }
    
        #page {
            margin-top:10px;
        }
        #page a{
    
            text-decoration:none;
            margin-right:5px;
        }
    
         </style>
     </head>
     <body>
         <center>
         <table border='1'>
             <caption><h2>学生信息表</h2></caption>
             <tr>
                 <th>ID</th> <th>用户名</th> <th>密码</th> <th>年龄</th> 
             </tr>
            
            <?php 
                foreach($res as $k => $v) {
            ?>
                <tr>
                    <td><?php echo $v['id']?></td>
                    <td><?= $v['username']?></td>
                    <td><?= $v['password']?></td>
                    <td><?= $v['age']?></td>
                </tr>
            
            <?php
            }
            ?>
         </table>
            
            <div id='page'>
                <?=
                    $show;
                ?>
            </div>
            
    
         </center>
     </body>
     </html>
  • 相关阅读:
    git更新或者还原本地代码
    log4net配置文件
    用ASP.NET MVC仿站糗事百科
    为表创建索引
    VisualStudio2008+水晶报表的使用
    C#中的位的或运算的理解
    char.IsLetter的使用
    C# 邮箱的使用
    NPOI DataTable导出excel
    NPOI DataSet导出excel
  • 原文地址:https://www.cnblogs.com/xujing6/p/6270919.html
Copyright © 2011-2022 走看看