colspan測試示例程序

效果展示:
這裏寫圖片描述

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang = "zh-CN"> 

<head>
  <meta http-equiv="Content-Type" content="text/html charset=utf-8">
  <title>colspan測試用例</title>
</head>
<body>
<div align="center">
  <table border="1">

  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Account</th>
  </tr>

  <tr>
    <td colspan="3">January</td>
  </tr>

  <tr>
    <td colspan="3">February</td>
  </tr>

  </table>
</div>

</body>
</html>

運行方法:代碼直接粘貼到一個html文件中,即可執行,顯示出效果。
**注:**1、第12行到第16行有幾對<th><\th>標籤,第19行與第23行的colspan就必須賦值成相應的數字,這樣每一行的兩邊纔可以對齊。

原創:http://blog.csdn.net/u013383042/article/details/52434756

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章