1. 何謂TABLE (TH=Table Header;TD=Table Data)
2. <CAPTION>、<TH>、<TD>與<TR>
|
<TABLE BORDER=2> <CAPTION>表格標籤</CAPTION> <TR> <TH>標頭一</TH><TH>標頭二</TH> <TR> <TD>資料一</TD><TD>資料二</TD> </TABLE> | → |
|
|---|
|
<TABLE BORDER=5> <CAPTION>表格標籤</CAPTION> <TR> <TH BGCOLOR=YELLOW>標頭一</TH> <TH BGCOLOR=RED>標頭二</TH> <TR> <TD>資料一</TD><TD>資料二</TD> </TABLE> | → |
|
|---|
COLSPAN:Column Span 欄距,即水平距離。
ROWSPAN:Row Span 排距,即垂直距離。
|
<TABLE BORDER=2> <CAPTION>表格標籤</CAPTION> <TR> <TH COLSPAN=2>標頭一</TH><TH>標頭二</TH> <TR> <TD>資料一</TD><TD>資料二</TD><TD>資料三</TD> </TABLE> | → |
|
|---|---|---|
|
<TABLE BORDER=2> <CAPTION>表格標籤</CAPTION> <TR> <TH ROWSPAN=2>標頭一</TH> <TD>資料一</TD> <TR> <TD>資料二</TD> <TR> <TH>標頭二</TH><TD>資料三</TD> </TABLE> | → |
|
|---|
4. CELLSPACING 與 CELLPADDING
CELLSPACING:格間距
CELLPADDING:格內容與邊緣距離
|
|
|
| <table border=2 cellspacing=1> | <table border=2 cellspacing=3> | <table border=2 cellspacing=5> |
|---|
|
|
|
| <table border=2 cellpadding=1> | <table border=2 cellpadding=3> | <table border=2 cellpadding=5> |
|---|
ALIGN (左右排列):left, center, right
VALIGN (上下排列):top, middle, bottom, baseline
|
<table border> <th width=100 align=left>靠左</td> <th width=100 align=center>置中</td> <th width=100 align=right>靠右</td> </table> |
→ |
|
|---|
|
<table border> <th height=100 valign=top>靠上</td> <th height=100 valign=middle>置中</td> <th height=100 valign=bottom>靠下</td> </table> |
→ |
|
|---|