td: 表格单元格

2017-06-06 16:20:00
admin
原创
343
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 <title>元素tr</title>
 </head>
 <body>
 <table>
 <CAPTION>Cups of coffee consumed by each senator</CAPTION>
 <tr> <th>Name <th>Cups <th>Type of Coffee <th>Sugar?
 <tr> <td>T. Sexton <td>10 <td>Espresso <td>No
 <tr> <td>J. Dinnen <td>5 <td>Decaf <td>Yes
 ...the rest of the table...
 </table><br>
 <table border="1" width="400" height="200">
 <tr bgcolor="skyblue"><td bgcolor="olive">bgcolor=olive</td><td colspan="2" width="200">colspan=2<br>bgcolor=skyblue</td>
 <tr><td align="right">align=right</td><td rowspan="2">rowspan=2</td><td>… </td>
 <tr><td valign="top">valign=top</td><td>… </td>
 <tr><td>…</td><td>… </td><td>… </td>
 </table>
 <p>…</p>
 <TABLE border="1" summary="This table summarizes travel expenses incurred during August trips to San Jose and Seattle">
 <CAPTION>
 Travel Expense Report
 </CAPTION>
 <TR>
 <TH></TH>
 <TH id="a2" axis="expenses">Meals</TH>
 <TH id="a3" axis="expenses">Hotels</TH>
 <TH id="a4" axis="expenses">Transport</TH>
 <TD>subtotals</TD>
 </TR>
 <TR>
 <TH id="a6" axis="location">San Jose</TH>
 <TH></TH>
 <TH></TH>
 <TH></TH>
 <TD></TD>
 </TR>
 <TR>
 <TD id="a7" axis="date">25-Aug-97</TD>
 <TD headers="a6 a7 a2">37.74</TD>
 <TD headers="a6 a7 a3">112.00</TD>
 <TD headers="a6 a7 a4">45.00</TD>
 <TD></TD>
 </TR>
 <TR>
 <TD id="a8" axis="date">26-Aug-97</TD>
 <TD headers="a6 a8 a2">27.28</TD>
 <TD headers="a6 a8 a3">112.00</TD>
 <TD headers="a6 a8 a4">45.00</TD>
 <TD></TD>
 </TR>
 <TR>
 <TD>subtotals</TD>
 <TD>65.02</TD>
 <TD>224.00</TD>
 <TD>90.00</TD>
 <TD>379.02</TD>
 </TR>
 <TR>
 <TH id="a10" axis="location">Seattle</TH>
 <TH></TH>
 <TH></TH>
 <TH></TH>
 <TD></TD>
 </TR>
 <TR>
 <TD id="a11" axis="date">27-Aug-97</TD>
 <TD headers="a10 a11 a2">96.25</TD>
 <TD headers="a10 a11 a3">109.00</TD>
 <TD headers="a10 a11 a4">36.00</TD>
 <TD></TD>
 </TR>
 <TR>
 <TD id="a12" axis="date">28-Aug-97</TD>
 <TD headers="a10 a12 a2">35.00</TD>
 <TD headers="a10 a12 a3">109.00</TD>
 <TD headers="a10 a12 a4">36.00</TD>
 <TD></TD>
 </TR>
 <TR>
 <TD>subtotals</TD>
 <TD>131.25</TD>
 <TD>218.00</TD>
 <TD>72.00</TD>
 <TD>421.25</TD>
 </TR>
 <TR>
 <TH>Totals</TH>
 <TD>196.27</TD>
 <TD>442.00</TD>
 <TD>162.00</TD>
 <TD>800.27</TD>
 </TR>
 </TABLE>
 <p>Note that marking up the table this way also allows user agents to avoid confusing the user with unwanted information. For instance, if a speech synthesizer were to speak all of the figures in the "Meals" column of this table in response to the query "What were all my meal expenses? ", a user would not be able to distinguish a day's expenses from subtotals or totals. By carefully categorizing cell data, authors allow user agents to make important semantic distinctions when rendering.</p>
 <p>Of course, there is no limit to how authors may categorize information in a table. In the travel expense table, for example, we could add the additional categories "subtotals" and "totals".</p>
 <p>This specification does not require user agents to handle information provided by the axis attribute, nor does it make any recommendations about how user agents may present axis information to users or how users may query the user agent about this information.</p>
 </body>
 </html>
文章分类
联系我们
电话: 18902328227
Email: 2689701946@qq.com
QQ: 2689701946
微信: 18902328227
地址: 广州番禺区繁华路
  • 在线客服
  • 关注微信
  • 联系电话
    • 欢迎咨询
    • 欢迎加入QQ群 303257430
  • 公众号:源宝网络
    • 联系电话及微信号 18902328227