HTML標記【表格的控制】!

 表格的控制
表格高度—height屬性
<table height=數值>(單位爲像素)

<html>
<body>
<table border=10 height=50%>
<tr><th>姓名</th><th>星座</th><th>性別</th></tr>
<tr><td>於欣芸</td><td>雙魚座</td><td>女</td></tr>
<tr><td>於欣嵐</td><td>巨蟹座</td><td>女</td></tr>
<tr><td>何寶林</td><td>處女座</td><td>男</td></tr>
</table>
</body>
</html>

===================================================
表格寬度——width屬性
<html>
<body>
<table border=10 witdh=50>
<tr><th>姓名</th><th>星座</th><th>性別</th></tr>
<tr><td>於欣芸</td><td>雙魚座</td><td>女</td></tr>
<tr><td>何寶林</td><td>處女座</td><td>男</td></tr>
<tr><td>於欣嵐</td><td>處女座</td><td>男</td></tr>
</table>
</body>
</html>
===================================================
表格外邊框顏色—bordercolor屬性
<table bordercolor=顏色值>

例;
<html>
<body>
<table border=10 width=50% bordercolor=Navy>
<tr><th>姓名</th><th>星座</th><th>性別</th></tr>
<tr><td>於欣芸</td><td>雙魚座</td><td>女</td></tr>
<tr><td>於欣嵐</td><td>巨蟹座</td><td>女</td></tr>
<tr><td>何寶林</td><td>處女座</td><td>男</td></tr>
</table>
</body>
</html>
==================================================
表格背景顏色—bgcolor屬性
<table bgcolor=顏色>

例:
<html>
<body>
<table border=10 width=50% bordercolor=navy bgcolor=yellow>
<tr><th>姓名</th><th>星座</th><th>性別</th></tr>
<tr><td>於欣芸</td><td>雙魚座</td><td>女</td></tr>
<tr><td>於欣嵐</td><td>巨蟹座</td><td>女</td></tr>
<tr><td>何寶林</TD><td>處女座</td><td>男</td></tr>
</table>
</body>
</html>
=======================================================
表格水平對齊方式——align屬性
align屬性可用於控制表格,在網頁中所採用的水平對齊方式,設置語法如下;
<table align=left或center或right>

例:
<html>
<body>
<table align=left border=3 >
<tr><td>靠左對齊表格</td></tr>
</table>
<table align=center border=3>
<tr><td>居中對齊表格</td></tr>
</table>
<table align=right border=3>
<tr><td>靠右對齊表格</td></tr>
</table>
</body>
</html>
=============================================

發佈了22 篇原創文章 · 獲贊 7 · 訪問量 20萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章