利用html写出table的代码

发布时间:2019-09-17编辑:脚本学堂
table的制作一般通过菜单栏中的命令,直接插入或绘制,本文讲了用html写出table的例子,需要的朋友来参考一下吧。
利用html写出一个table的代码例子:
复制代码 代码示例:
<html>
      <head>
         <title>This is my first web</title>
      </head>
      <body>
          <table bgcolor="yellow" border="1" bordercolor="blue" cellspacing="0">
              <thead>
                  <caption valign="center" >XX大学2004-2005课表</caption>
                  <hr></hr>
                 <caption align="left">年级=2004,学院=文学院</caption>
             </thead>
             <tbody>
                 <tr bgcolor="cyan">
                     <th rowspan="2">课程名称</th>
                     <th rowspan="2">周学时</th>
                     <th rowspan="2">周次</th>
                     <th rowspan="1" colspan="7">节次</th>
                     <th rowspan="2">上课地点</th>
                     <th rowspan="2">合班</th>
                     <th rowspan="2">上课人数</th>
                     <th rowspan="2">开课院</th>
                 </tr>
                 <tr bgcolor="cyan">
                     <td>周一</td>
                    <td>周二</td>
                     <td>周三</td>
                     <td>周四</td>
                     <td>周五</td>
                     <td>周六</td>
                     <td>周日</td>
                 </tr>
                 <tr>
                     <td>大学生思想道德修养</td>
                     <td>3</td>
                     <td>6-17</td>
                     <td bgcolor="green" bordercolor="blue">8-10</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td bgcolor="green" bordercolor="blue">&nbsp;</td>
                     <td>1区 4202</td>
                     <td>戏剧影视、哲学</td>
                     <td>180</td>
                     <td>公共政法教学</td>
                 </tr>
             </tbody>
         </table>
     </body>
</html>
 
以上写出的table代码也是如此简单吧!