登录  /  注册
博主信息
博文 48
粉丝 0
评论 0
访问量 38896
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
使用 table 练习制作简易课表--2019年09月06日20时00分
小星的博客
原创
2559人浏览过

最近学习了 table, 练习制作一个课表看看。

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>

        table {
            width: 600px;
            /* 设置了此属性则 bordr-radius无效,记住 */
            /* border-collapse: collapse; */
            border-collapse: separate;
            box-shadow: 4px 4px 8px grey;
            border-radius: 20px;
            background: url("bg.jpg") center no-repeat;
            background-size: 100% 100%;
            opacity: .8;
            /* 设置相邻单元格的边框间的距离(仅用于 “边框分离” 模式)。 */
            border-spacing: 0;
        }
        th:first-of-type {
            border-radius: 20px 0 0 0;
        }
        th:last-of-type {
            border-radius: 0 20px 0 0;
        }
        table td.flag {
            border-radius: 0 0 0 20px;
        }
        table tr:last-of-type td:last-of-type {
            border-radius: 0 0 20px 0;
        }
        
        th,td {
            padding: 10px;  
            border-top: 1px solid #727070;
            border-left: 1px solid #727070;
            text-align: center;
            color: #fff;
        }
        th {
            background-color: black;
            height: 26px;
        }

    </style>
    <title>简易课表</title>
</head>

<body>
    <table>
        <caption><h3>课程表</h3></caption>
        <thead>
            <tr>
                <th>星期</th>
                <th>星期一</th>
                <th>星期二</th>
                <th>星期三</th>
                <th>星期四</th>
                <th>星期五</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td rowspan="3">8::00 ~ 11:30</td>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td colspan="6">午间休息</td>
            </tr>
            <tr>
                <td rowspan="4" class="flag">13:00 ~ 17:30</td>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
            <tr>
                <td>语文</td>
                <td>数学</td>
                <td>英语</td>
                <td>物理</td>
                <td>历史</td>
            </tr>
        </tbody>

    </table>
</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

TIM截图20190916215543.png

大功告成!

批改状态:合格

老师批语:这个课程表惊到我了, 一个普通表格也能做得这么完美
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学