HTML DOM Table attribut summary
Définition et utilisation
ensembles de propriétés sommaires ou renvoie un aperçu de la table.
ensembles de propriétés sommaires ou renvoie un aperçu de la table.
grammaire
Définissez l'attribut sommaire:
tableObject.summary="text"
Renvoie les attributs de synthèse:
tableObject.summary
Astuce: la propriété sommairen'a pas de valeur par défaut.
值 | 描述 |
---|---|
text | 摘要文本 |
support du navigateur
Tous les principaux navigateurs prennent en charge l'attribut summary
Exemples
Exemples
Pop tableau récapitulatif:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
alert(document.getElementById('myTable').summary);
}
</script>
</head>
<body>
<table id="myTable" border="1" summary="例如表中的员工">
<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()">显示表格描述</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
alert(document.getElementById('myTable').summary);
}
</script>
</head>
<body>
<table id="myTable" border="1" summary="例如表中的员工">
<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()">显示表格描述</button>
</body>
</html>
Essayez »
Table Object