绘制一个带边框的表格 table

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        table{
            cellspacing:0;
            border-collapse: collapse;
            text-align: center;
        }
        th{
            font-size: 20px;
            color: #222222;
            border: 0.1px solid #222222;
        }
        td{
            font-size: 18px;
            color: #383838;
            border: 0.1px solid #222222;
        }
        colgroup{
            background: transparent;
        }
        col{
            width: 225px;
            height: 40px;
        }
    </style>
</head>
<body>
  <table>
      <colgroup>
          <col span="3">
      </colgroup>
      <tr>
          <th>姓名</th>
          <th>年龄</th>
          <th>性别</th>
      </tr>
      <tr>
          <td>孙磊</td>
          <td>23</td>
          <td>男</td>
      </tr>
      <tr>
          <td>芳</td>
          <td>24</td>
          <td>女</td>
      </tr>
  </table>
</body>
</html>

效果如下:

猜你喜欢

转载自blog.csdn.net/a872822645/article/details/85763180
今日推荐