HTML5 <caption> 标签

定义和用法

<caption> 标签定义表格标题。<caption> 标签必须紧随 <table> 标签之后。

HTML 4.01 与 HTML5 之间的差异

HTML 4.01 不赞成使用 align 属性。在 HTML5 中,不支持该标签。请使用 CSS 代替。

例子:

<table>
  <caption>This is a caption</caption>
  <tr>
  <td>Cell 1</td>
  <td>Cell 2</td>
  </tr>
</table>

属性

属性 描述 4 5
align
  • left
  • right
  • top
  • bottom
如何对齐标题。不支持。请使用样式代替。 4  

标准属性

class, contenteditable, contextmenu, dir, draggable, id, irrelevant, 
lang, ref, registrationmark, tabindex, template, title

如需完整的描述,请访 HTML5 中标准属性

事件属性

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

如需完整的描述,请访 HTML5 中事件属性

Copyright © 2009-2011 Web前端开发-Web前端工程师 | Web前端学习之路 版权所有