HTML5元素-表格元素

HTML5元素-表格元素

<!-- 生成基本的表格 -->
<table>
	<tr>
		<th></th>
		<th></th>
	</tr>
	<tr>
		<th></th>
		<tr></tr>
	</tr>
</table>

<!-- 为表格添加 表头,表体,表脚 -->
<table>
	<thead> 
		<tr>
			<th>  </th><th>  </th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th>  </th>
			<tr>  </tr>
		</tr>
	</tbody>
	<tfoot>
		<tr>
			<th>  </th>
			<tr>  </tr>
		</tr>
	</tfoot>
</table>

<!-- 制作不规则表格 -->
<!-- 行列合并属性: 行合并 rowspan 列合并 colspan -->

<!-- 把表头与单元格关联起来 -->
<!-- 使用 headers 属性 -->
<table>
	<thead> 
		<tr>
			<th id = "first col">  </th>
			<th id = "seccond col">  </th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th id = "first row" headers = "first col">  </th>
			<tr headers = "seccond col first row">  </tr>
		</tr>
	</tbody>
	<tfoot>
		<tr>
			<th id = "second row" headers = "first col">  </th>
			<th headers = "seccond col second row" >  </th>
		</tr>
	</tfoot>
</table>

<!-- 为表格添加标题 -->
<table>
	<caption>标题</caption>
</table>

<!-- 处理列 -->
<table>
	<colgroup id = "colgroup1" span = "3"/>
	<colgroup id = "colgroup2" span = "2"/>
</table>

<!-- 处理个别列 -->
<table>
	<colgroup id = "colgroup1">
		<col id = "col1and2" span = "2"/>
		<col id = "col3"/>
	</colgroup>
</table>

<!-- 设置表格边框 -->
<!-- 使用属性 border 其值必须设置为1或空字符串"" -->

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值