博主信息
博文 9
粉丝 1
评论 0
访问量 11111
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
table表格制作
jiangxiaobai
原创
2230人浏览过

table的制作,设置圆角的话查了下貌似说用css3比较容易做出来,看了网上代码还是不太理解,属性太多。得慢慢消化实战才能记得住

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="static/style.css">
    <title>表格</title>
</head>
<body>
<table>
    <caption>产品价格表</caption>
    <thead>
    <tr>
    <th>型号</th>
    <th>硬盘</th>
    <th>内存</th>
    <th>cpu</th>
    <th>尺寸</th>
    <th>颜色</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td rowspan="2">mac book pro</td>
        <td>128g</td>
        <td>4g</td>
        <td>i3</td>
        <td>13.3</td>
        <td>银</td>
    </tr>

    <tr>

        <td>256</td>
        <td>8g</td>
        <td>i5</td>
        <td>13.3</td>
        <td>灰</td>
    </tr>
    <tr>
        <td rowspan="2">mac book air</td>
        <td>256</td>
        <td>8g</td>
        <td>i5</td>
        <td>13.3</td>
        <td>灰</td>
    </tr>
    <tr>

        <td>256</td>
        <td>8g</td>
        <td>i5</td>
        <td>13.3</td>
        <td>灰</td>
    </tr>

    </tbody>
    <tfoot>
    <tr>
        <td>备注:</td>
        <td colspan="5">颜色以当天发货为准</td>
    </tr>
    </tfoot>
</table>
</body>
</html>

运行实例 »

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

实例

table{
    border: 1px solid #444444;
    width: 600px;
    margin: 40px auto;

    box-shadow: 2px 2px 2px #888888;
    position: relative;

}
table caption{
    font-weight: bold;
    font-size: 1.3rem;
    margin-bottom: 5px;
}
th, td {
    border: 1px solid #444444;
    text-align: center;
    padding: 10px;
}
table thead tr th{
    background-color: #cccccc;
}

table tbody > tr:first-of-type > td:first-of-type {
    background-color: lightcoral;

}
table tbody > tr:nth-last-of-type(2) > td:first-of-type {
    background-color: lightcyan;

}
thead>tr:nth-of-type(1)>th:nth-of-type(1) {
    border-top-left-radius: 15px;
}

thead>tr:nth-of-type(1)>th:last-of-type {
    border-top-right-radius: 15px;
}

tfoot>tr:nth-of-type(1)>td:nth-of-type(1) {
    border-bottom-left-radius: 15px;
}

tfoot>tr:nth-of-type(1)>td:last-of-type {
    border-bottom-right-radius: 15px;
}

运行实例 »

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

WX20190909-123325@2x.png

批改状态:合格

老师批语:一个简单的圆角表格, 不知难住了多少英雄好汉
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系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+教程免费学