Is it suitable/semantic to开发者_Go百科 use <th>
tag for column headers. I.e. should Price
, and Qty
be in <th>
tags for table like this?
+-------+--------+---------+--------+
| | apples | oranges | lemons |
|-------+--------+---------+--------|
| Price | 100 | 200 | 300 |
|-------+--------+---------+--------|
| Qty | 10 | 10 | 10 |
+-------+--------+---------+--------+
Is it suitable/semantic to use tag for column headers.
Yes
I.e. should Price, and Qty be in tags for table like this?
Those are row headings, but still, yes.
<table>
<tbody>
<tr>
<td>
<td scope="col">apples <!-- both heading and data so use td with scope -->
<!-- etc etc -->
<th scope="row">Price
Yes,u can do this
<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>
and see the link http://www.w3.org/TR/html4/struct/tables.html
精彩评论