Table summaryProperty
Table Object
Definition and Usage
The summary property sets or returns the summary of a table.
The summary property sets or returns the summary of a table.
Syntax
Set the summary property:
tableObject.summary="text"
Return the summary property:
tableObject.summary
Tip:The summary property has no default value.
| Value | Description |
|---|---|
| text | Summary text |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the summary property
Example
Example
Alert the table summary:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example(example.com)</title>
<script>
function displayResult(){
alert(document.getElementById('myTable').summary);
}
</script>
</head>
<body>
<table id="myTable" border="1" summary="For example, the employees in the table">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
<br>
<button type="button" onclick="displayResult()">Show table description</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Example(example.com)</title>
<script>
function displayResult(){
alert(document.getElementById('myTable').summary);
}
</script>
</head>
<body>
<table id="myTable" border="1" summary="For example, the employees in the table">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
<br>
<button type="button" onclick="displayResult()">Show table description</button>
</body>
</html>
Try it Yourself »
Table Object Other Extensions