DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> XML學習教程 >> XML詳解
大話 XML(二):XML 與 HTML 的比較(續)
編輯:XML詳解     

第二種表達方式。顯示的效果:

編號 001

姓名 張三

性別 男

年齡 20

HTML 原始碼:

<body>
<table width="300" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="300" border="0" cellspacing="1" cellpadding="0" bgcolor="1">
<tr>
<td>編號</td>
<td>001</td>
</tr>
<tr>
<td>姓名</td>
<td>張三</td>
</tr>
<tr>
<td>性別</td>
<td>男</td>
</tr>
<tr>
<td>年齡</td>
<td>20 </td>
</tr>
</table>
</td>
</tr>
</table>
</body>

在這個版本裡,同樣一份學生資料,卻得靠一層又一層的 table、tr、td 標籤,以及琳瑯滿目的寬度、間距、背景色屬性堆疊出來。資料本身明明只有「001、張三、男、20」這麼幾個欄位,標記卻膨脹成一大片,讓人一眼看不出哪裡才是真正的內容。這正是 HTML 用來呈現表格資料時的寫照:表現形式與資料糾纏在一起,越寫越臃腫。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved