2011-10-08 74 views
1

是否適合/語義使用<th>標籤的列標題。即應該Price,並Qty<th>標籤爲表這樣嗎?<th>的列標題

+-------+--------+---------+--------+ 
|  | apples | oranges | lemons | 
|-------+--------+---------+--------| 
| Price | 100 | 200  | 300 | 
|-------+--------+---------+--------| 
| Qty | 10  | 10  | 10  | 
+-------+--------+---------+--------+ 
+0

http://validator.w3.org有答案... –

回答

2

是否適合/語義使用標籤的列標題。

即價格和數量應該在這樣的表格標籤中嗎?

這些都是行標題,不過,是的。

<table> 
    <tbody> 
     <tr> 
      <td> 
      <td scope="col">apples <!-- both heading and data so use td with scope --> 
     <!-- etc etc --> 
      <th scope="row">Price 
+0

酷,謝謝,也謝謝對於範圍屬性,不知道這一點。是的,我的意思是**行**標題 – welldan97

1

是,U可以做到這一點

<TABLE border="1"> 
<CAPTION><EM>A test table with merged cells</EM></CAPTION> 
<TR><TH rowspan="2"><TH colspan="2">Average 
    <TH rowspan="2">Red<BR>eyes 
<TR><TH>height<TH>weight 
<TR><TH>Males<TD>1.9<TD>0.003<TD>40% 
<TR><TH>Females<TD>1.7<TD>0.002<TD>43% 
</TABLE> 

,並看到該鏈接http://www.w3.org/TR/html4/struct/tables.html