表格设计

简单整理一下今天学习的表格设计

table:表格
tr:行
th:列
td:表头(默认加粗)
border属性:边框,主要属性包括:border-style(线性)、border-width、border-color;
vertical-align:单元格文字位置:top,bottom,right,left;
tr:hover{background-color:red} :鼠标悬停变化;
padding:内边距
tr:nth-child(oven){background-color:red}:偶数行表格背景颜色设置,ven可改动
源码如下:

<html>
    <head>
        <title>表格效果</title>
        <style>
            
            table{
                border-collapse: collapse;
            }
            table{
                width: 100%
                
            }
           table, th,tr,td{
                border-width: 10px;
                border-color: blue;
                border-style:dashed;
                text-align: center; 
                background-color: aquamarine;
                padding: 50px;
                
            }
            
            
            tr:hover{background-color:pink;}
        </style>
    </head>
    <body>
        <div>
            <table>
                <tr>
                    <th>姓名</th>
                    <th>学号</th>
                </tr>
                
                <tr>
                    <td>xmc</td>
                    <td>2018</td>
                </tr>
                <tr>
                    <td>wjl</td>
                    <td>2019</td>
                </tr>
            </table>
            
        </div>
    </body>
</html>

效果图如下:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值