X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Table caption Property

Table Object Reference Table Object

Example

Alert the text inside a caption element:

alert(document.getElementById("myTable").caption.innerHTML);

Try it yourself »


Definition and Usage

The caption property returns the <caption> element of a table.

The <caption> element defines a caption for a table.

Note: The <caption> tag must be inserted immediately after the <table> tag. You can specify only one caption per table. By default, the caption will be centered above the table.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The caption property is supported in all major browsers.


Syntax

tableObject.caption

Technical Details

Return Value: The <caption> element of the table, or null if it is not defined


Related Pages

HTML reference: HTML <caption> tag


Table Object Reference Table Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook