此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
表格
- 表格用行和列来展示信息。
- 用
<table>开始。 - 每一行是一个
<tr>(table row,表格行)。
单元格
- 在每一行里,每个单元格是一个
<td>(table data,表格数据)。 - 作为表头的单元格(比如列标题)用
<th>—— 它会显示成粗体。 - 让每一行的单元格数量保持一样。
English
<table>
<tr><th>Fruit</th><th>Colour</th></tr>
<tr><td>Apple</td><td>Red</td></tr>
<tr><td>Banana</td><td>Yellow</td></tr>
</table>
常见错误
- 单元格(
<td>)放在行(<tr>)里面。 - 表头单元格用
<th>。
现在你来试试
- 表格就是一些行(
<tr>),行里装着单元格(<td>或<th>)。 - 做一个小表格,再加一个表头单元格。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Make a table with 二 rows. Each row is a <tr>, and put a <td> cell inside each row.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Add a header cell so the column has a title. Use <th> instead of <td> for it.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Build a full table: a header row with two <th> cells, Name and Score, then 二 data rows of <td> cells.