<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<p>Click the button to return the value of the rowspan attribute of td with id "myTd".</p>
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td id="myTd" rowspan="2">January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$100</td>
</tr>
</table>
<br>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myTd").rowSpan;
document.getElementById("demo").innerHTML = "The value of rowspan is: " + x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_td_rowspan by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:50 GMT -->
</html>