h5表格

这篇博客探讨了如何使用HTML5创建表格,特别是关注于嵌套表单的实现,详细介绍了通过table元素构建的表格结构。
摘要由CSDN通过智能技术生成

table表单

<table>
	<tr>
		<td>11</td>
		<td>12</td>
	</tr>
	<tr>
		<td>21</td>
		<td>22</td>
	</tr>
	<tr>
		<td>31</td>
		<td>32</td>
	</tr>
</table>
11 12
21 22
31 32
   <table>
      <tr>
        <th colspan="2">Animals</th>
      </tr>
      <tr>
        <th colspan="2">Hippopotamus</th> //colspan=2占两列
      </tr>
      <tr>
        <th rowspan="2">Horse</th>
        <td>Mare</td>
      </tr>
      <tr>
        <td>Stallion</td>
      </tr>
      <tr>
        <th colspan="2">Crocodile</th>
      </tr>
      <tr>
        <th rowspan="2">Chicken</th> //rowspan=2占两行
        <td>Hen</td>
      </tr>
      <tr>
        <td>Rooster</td>
      </tr>
    </table>
html {
    font-family: sans-serif;
  }
  
  table {
    border-collapse: collapse;
    border: 2px solid rgb(200,200,200);
    letter-spacing: 1px;
    font-size: 0.8rem;
  }
  
  td, th {
    border: 1px solid rgb(190,190,190);
    padding: 10px 20px;
  }
  
  th {
    background-color: rgb(235,235,235);
  }
  
  td {
    text-align: center;
  }
  
  tr:nth-child(even) td {
    background-color: rgb(250,250,250);
  }
  
  tr:nth-child(odd) td {
    background-color: rgb(245,245,245);
  }
  
  caption {
    padding: 10px;
  }
<tr></tr>此行中添加<td colspan="2">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值