aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/htmltableelement/createcaption/index.html
blob: 86aa3ab21b61e5c1ced57a3b775a956e38c5abb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
title: HTMLTableElement.createCaption()
slug: Web/API/HTMLTableElement/createCaption
translation_of: Web/API/HTMLTableElement/createCaption
---
<div>
<div>
<div>{{APIRef("HTML DOM")}}</div>
</div>
</div>

<p>这个 <code><strong>HTMLTableElement.createCaption()</strong></code> 方法返回这个 table 元素的 caption(HTMLTableCaptionElement). 如果这个 table 没有 caption,这个方法创建并返回 caption.</p>

<h2 id="Syntax" name="Syntax">语法</h2>

<pre class="syntaxbox">HTMLTableCaptionElement = table.createCaption()</pre>

<h2 id="Example" name="Example">示例</h2>

<pre class="brush:js;gutter:false;">mycap = mytable.createCaption();</pre>

<h2 id="Specification" name="Specification">Specification</h2>

<ul>
 <li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-96920263">createCaption</a></li>
</ul>