HTML 5 <caption> 標簽
定義和用法
<caption> 標簽定義表格標題。<caption> 標簽必須緊隨 <table> 標簽之后。
HTML 4.01 與 HTML 5 之間的差異
HTML 4.01 不贊成使用 align 屬性。在 HTML 5 中,不支持該標簽。請使用 CSS 代替。
例子:
<table>
<caption>This is a caption</caption>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
屬性
屬性 | 值 | 描述 | 4 | 5 |
---|---|---|---|---|
align |
|
如何對齊標題。不支持。請使用樣式代替。 | 4 |
標準屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請訪 HTML 5 中標準屬性。
事件屬性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,請訪 HTML 5 中事件屬性。