博主信息
博文 9
粉丝 0
评论 0
访问量 7959
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
CSS制作一张带有四个圆角的表格
橙汁的博客
原创
818人浏览过

CSS制作一张带有四个圆角的表格实例

<!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">
    <title>课程表</title>
    <style>
        table {
            width: 800px;
            /* border: 1px solid #000; */
            /* border-collapse: collapse; */
            margin: 50px auto;
            position: relative;
        }
        
        th,
        td {
            border: 1px solid #000;
            text-align: center;
            padding: 10px;
        }
        
        table caption {
            font-size: 1.6em;
            font-weight: bold;
            margin-bottom: 20px;
        }
        
        table thead>tr:first-of-type {
            background-color: aqua;
        }
        
        table tbody>tr:first-of-type>td:first-of-type {
            background-color: bisque;
        }
        
        table tbody>tr:nth-last-of-type(2)>td:first-of-type {
            background-color: aliceblue;
        }
        
        table tfoot>tr:last-of-type {
            background-color: ivory;
        }
        
        table:before {
            content: '';
            width: 800px;
            height: 300px;
            position: absolute;
            left: 0;
            top: 54px;
            background-image: url(http://b.hiphotos.baidu.com/image/pic/item/908fa0ec08fa513db777cf78376d55fbb3fbd9b3.jpg);
            background-size: cover;
            opacity: 0.5;
            border-radius: 12px;
        }
        
        table {
            border-spacing: 0;
            border-radius: 12px;
        }
        
        table thead>tr>th:first-of-type {
            border-top-left-radius: 12px;
        }
        
        table thead>tr>th:last-of-type {
            border-top-right-radius: 12px;
        }
        
        table tfoot tr {
            border-bottom-left-radius: 12px;
        }
        
        table tfoot td:first-of-type {
            border-bottom-left-radius: 12px;
        }
        
        table tfoot td:last-of-type {
            border-bottom-right-radius: 12px;
        }
    </style>
</head>

<body>
    <table>
        <caption>小学五年级课程表</caption>
        <thead>
            <tr>
                <th>星期</th>
                <th>星期一</th>
                <th>星期二</th>
                <th>星期三</th>
                <th>星期四</th>
                <th>星期五</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td rowspan="3">上午<br>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 rowspan="3">下午<br>14:00-16:00</td>
                <td>外语</td>
                <td>外语</td>
                <td>外语</td>
                <td>语文</td>
                <td>美术</td>
            </tr>
            <tr>
                <td>体育</td>
                <td>美术</td>
                <td>外语</td>
                <td>语文</td>
                <td>体育</td>
            </tr>
        </tbody>
        <tfoot>
            <td>备注:</td>
            <td colspan="5">周未家长必须来学校帮助孩子打扫卫生</td>
        </tfoot>
    </table>
</body>

</html>

运行实例 »

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

847.jpg

批改状态:合格

老师批语:一个简单的圆角表格, 不知难住了多少英雄好汉, 加油
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

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

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