博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HTML5 1.5 表格元素
阅读量:4548 次
发布时间:2019-06-08

本文共 1798 字,大约阅读时间需要 5 分钟。

1、表格构成的三个基本要素 table:表格的外框、范围,用来定义表格;tr:表格的行;td:表格的单元格

2、th元素:为表格添加单元格,是tr的子元素

3、colspan:横向合并单元格,语法为<td><colspan>="3"</td>

4、rowspan:竖向合并单元格,语法为<td><rowspan>="3"</td>

5、caption元素:给表格添加标题,是table的子元素,caption的align属性可以设置标题位置。不过一般用css设置标题位置

6、thead\tfoot\tbody元素:表头、页脚、主体。一般结合css、java来使用

7、colgroup元素

     用来组合列,她的span属性可以设置组合列的数目;它可以包含一个子元素 col.

     为table的子元素,必须放在caption元素之后,thead元素之前

8、col元素

     col可以用来设定列的属性;它可以使用span属性

     col一般作为colgroup元素的子元素配合使用

<!DOCTYPE html>

< html lang="zh-cn">

<head>

          <meta charset="UTF-8">

          <title>例5</title>

</head>

<body bgcolor=”#fedcbd“>

<table border=“2”  align=“center”  style=“font-size:18px;”>

         <colgroup span=”4“>

                      <col span=“1” style=“width:150px;background=blue”>

                      <col span=“2” style=“width:200px;background=red”>

                       <col span=“1” style=“width:150px;background=green”>

         </colgroup>

         <caption style="font-size:30px;color:yellow">特殊符号的使用</caption>

         <thead>

                      <tr style="height:50px;background=yellow;"> <th>符号</th><th>实体名称</th><th>实体数量</th><th>描述</th></tr>

         </thead>

         <tbody>

                      <tr align="center"> <td></td><td>&ampnbsp</td><td>&amp#160</td><td>空格</td></tr>

                      <tr align="center"> <td><</td><td>&lt</td><td>&amplt#60</td><td>小于</td></tr>        

                      <tr align="center"> <td>></td><td>&gt</td><td>&ampgt#62</td><td>大于</td></tr> 

                      <tr align="center"> <td>&</td><td>&ampamp</td><td>&amp#38</td><td>连接符号</td></tr>

                      <tr align="center"> <td>“</td><td>&quot</td><td>&amp#34</td><td>双引号</td></tr>

                      <tr align="center"> <td>±</td><td>&plusmn</td><td>&amp#177</td><td>正负值</td></tr>        

                      <tr align="center"> <td>©</td><td>&copy</td><td>&amp#169</td><td>著作权</td></tr> 

                      <tr align="center"> <td>℗</td><td>&reg</td><td>&amp#174</td><td>商标</td></tr>

        </tbody>

         <tfoot>

                      <tr > <td colspan=”4“ style=”height:40px;background:yellow“>其他的用到时查询即可知</td></tr>

         </tfoot>

</table>

</body>

</html>

转载于:https://www.cnblogs.com/piaopiaoppp/p/5256215.html

你可能感兴趣的文章
微信小程序picker组件 - 省市二级联动
查看>>
Dynamics CRM 给视图配置安全角色
查看>>
Eclipse修改已存在的SVN地址
查看>>
C++ ACM基础
查看>>
(转)使用 python Matplotlib 库绘图
查看>>
进程/线程切换原则
查看>>
正则表达式语法
查看>>
20165301 2017-2018-2 《Java程序设计》第四周学习总结
查看>>
Vue的简单入门
查看>>
使用最快的方法计算2的16次方是多少?
查看>>
urllib 中的异常处理
查看>>
【SQL Server高可用性】高可用性概述
查看>>
通过SQL Server的扩展事件来跟踪SQL语句在运行时,时间都消耗到哪儿了?
查看>>
SQL优化:重新编译存储过程和表
查看>>
PCB“有铅”工艺将何去何从?
查看>>
Solr环境搭建
查看>>
ASP.NET的URL过滤
查看>>
自己写的Web服务器
查看>>
自定义定时组件
查看>>
2-素数打比表
查看>>