'rowSpan' Example : rowSpan « Javascript Properties « JavaScript Reference

'rowSpan' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    document.getElementById("myTableHeader").rowSpan = 2;
}
function function2() {
    location.reload();
}
</script>
<table width="542" border="10" bordercolor="red" cellpadding="20">
    <tr>
        <th id="myTableHeader">Cell 1</th>
        <th>Cell 2</th>
        <th id="th5">Cell 3</th>
    </tr>
    <tr>
        <th>Cell 4</th>
        <th id="th2">Cell 5</th>
        <th>Cell 6</th>
    </tr>
    <tr>
        <th>Cell 7</th>
        <th>Cell 8</th>
        <th>Cell 9</th>
    </tr>
    <tr>
        <th >Cell 10</th>
        <th >Cell 11</th>
        <th >Cell 12</th>
    </tr>
</table>
<input type="button" value="Span(2) Cell 1" onClick="function1();">
<input type="button" value="Restore" onClick="function2();">
</body>
</html>

    
      
      








Related examples in the same category

1.'rowSpan' Syntax and Note
2.'rowSpan' is applied to