我的第六个网页制作:table标签

时间:2022-05-07
本文章向大家介绍我的第六个网页制作:table标签,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
 1 <!doctype html>
 2 <html>
 3    <head>
 4    <meta charset="utf-8">
 5       <title>这是我的第五个html代码</title>
 6       <!--可以通过bgcolor关键字修改背景颜色-->
 7       <body bgcolor="#FF0000">
 8       <table border="1px" cellpadding="5px" cellspacing="5px">
 9       <!--
10       <caption>学生信息表</caption>
11       -->
12       <!--对齐方式不同,下面是下对齐方式,上面是上对齐方式-->
13       <caption align="bottom">学生信息表</caption>
14       <!--
15       <tr><th>姓名</th><th>年龄</th><th>性别</th><th>班级</th></tr>
16       <tr><td>张三</td><td>18</td><td>男</td><td>一班</td></tr>
17       <tr><td>李四</td><td>19</td><td>女</td><td>二班</td></tr>
18       <tr><td>赵五</td><td>20</td><td>男</td><td>三班</td></tr>
19       <tr><td>韩六</td><td>21</td><td>女</td><td>四班</td></tr>
20       -->
21       <tr><th>姓名</th><th>年龄</th><th>性别</th><th>班级</th></tr>
22       <!--行合并,合并两行-->
23       <tr><td>张三</td><td>18</td><td>男</td><td>一班</td></tr>
24       <tr><td colspan="2">李四</td><td>女</td><td>二班</td></tr>
25       <!--列合并,合并两列-->
26       <tr><td rowspan="2">赵五</td><td>20</td><td>男</td><td>三班</td></tr>
27       <tr><td>21</td><td>女</td><td>四班</td></tr>
28       </table>
29       </body>
30     </head>
31 </html>