我所制作的用户信息表展示

原创2019-06-14 15:25:25157
摘要:<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>{$title|default=&
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$title|default='默认标题test4'}</title>

    <link rel="stylesheet" href="/static/css/bootstrap.css">
    <script src="/static/js/jquery-3.4.0.min.js"></script>
    <script src="/static/js/bootstrap.js"></script>
</head>
<body>
<!--<?php
print_r($data);
?>-->
<div class="container">
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            <h2 class="text-center">学生信息表</h2>
            <table class="table table-default table-bordered table-hover text-center">
                <tr class="bg-primary">
                    <td>ID</td>
                    <td>姓名</td>
                    <td>邮箱</td>
                    <td>课程</td>
                    <td>成绩</td>
                </tr>

 <!--循环标签volist   name:它的值就是需要被循环的变量$data  id:当前模板中自定义的循环变量,只在当前模板用-->
 {volist name="data" id="list" }
                <tr>
                    <td>{$list.id}</td>
                    <td>{$list.name}</td>
                    <td>{$list.email}</td>
                    <td>{$list.course}</td>
                    <td>
 <!--处理一下当前成绩,一旦成绩大于82为合格-->
 {if $list.grade < 82}
                        <span style="color: red">不及格</span>
 {else/}
                        <span style="color: green">合格</span>
 {/if}
                    </td>
                </tr>
 {/volist}
            </table>
        </div>
        <div class="col-md-2"></div>

 <!--做一个分页条-->
 <div class="text-center">
 {$data|raw}
        </div>

    </div>
</div>



</body>
</html>



批改老师:查无此人批改时间:2019-06-14 16:30:33
老师总结:完成的不错。文件上传,后缀名要判断,文件大小要判断。以免别人上传故意上传垃圾文件。继续加油。

发布手记

热门词条