HTML <caption>标签用于为表创建标题。每个table只能有一个标题。
<!DOCTYPE html> <html> <head> <title>HTML caption Tag</title> </head> <body> <h2>Cricketers List</h2> <table width="100%"> <caption>Indian Cricketers</caption> <th>Name</th> <tr> <td>Sachin Tendulkar</td> </tr> <tr> <td>M S Dhoni</td> </tr> <tr> <td>Suresh Raina</td> </tr> <tr> <td>Virat Kohli</td> </tr> </table> </body> </html>
这将产生以下结果-
此标签支持 HTML 中描述的所有全局属性。
此标签支持 HTML 中描述的所有事件属性。
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)