- table - 标签
简单的 HTML 表格由 table 元素以及一个或多个 tr、th 或 td 元素组成。
tr 元素定义表格行,th 元素定义表头,td 元素定义表格单元。
更复杂的 HTML 表格也可能包括 caption、col、colgroup、thead、tfoot 以及 tbody 元素。
表格练习:
<!-- html 部分 -->
<table>
<tbody>
<tr>
<td class="f01">操作系统:</td>
<td>Windows 7</td>
</tr>
<tr>
<td class="f01">CPU:</td>
<td>Intel 或 AMD双核(Dual core) 2.8 GHz</td>
</tr>
</tbody>
</table>
<!-- css 部分 -->
<style>
.main_right .part .chart_box td {
font-size: 14px;
color: #666;
line-height: 1.5;
}
.main_right .part .chart_box td.f01 {
width: 83px;
color: #303030;
font-weight: bold;
text-align: right; /* - 把文本排列到右边。 - */
vertical-align: top; /* - 把元素的顶端与行中最高元素的顶端对齐 - */
}
</style>