Table Object caption Property
Table Object
Definition and Usage
The caption property sets or returns the caption element of a table.
The <caption> element defines a table caption. The <caption> tag must be
inserted immediately after the <table> tag. You can specify only one caption per
table. Usually the caption will be centered above the table.
Syntax
|
tableObject.caption=captionObject
|
Example
Example
The following example returns the text in the <caption> element of a table:
<html>
<head>
<script type="text/javascript">
function alertCaption()
{
alert(document.getElementById("table1").caption.innerHTML);
}
</script>
</head>
<body>
<table id="table1" border="1">
<caption>This is a table caption</caption>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick=alertCaption()
value="Alert table caption" />
</body>
</html>
|
Try it yourself »
|
Table Object
Create a free Flash website with our simple, online web design editing platform. Stunning templates
and user-friendly tools make website building easy and fun.
Start Creating your free website now!

Whether you're new to XML or already an advanced user, the user-friendly views and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to meet your XML and Web development needs from start to finish.
New features in Version 2010!
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- XBRL validator, taxonomy editor, taxonomy wizard
- Support for Office Open XML (OOXML)
- Graphical WSDL 1.1/2.0 editor & SOAP debugger
- JSON editing & conversion
- Java, C#, C++ code generation
- 32-bit and 64-bit versions
- And much more!
Download a free trial today!
|
|
|
|