<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<title>dom Delete table row and column instances </title>
<body>
<table id= "table1" bordercolor= "#000000" width= "" border= "1" >
<tbody>
<tr>
<td>00</td>
<td>01</td>
<td>02</td>
<td>03</td>
</tr>
<tr>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
</tr>
<tr>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
</tr>
<tr>
<td>30</td>
<td>31</td>
<td>32</td>
<td>33</td>
</tr>
<tr>
<td>40</td>
<td>41</td>
<td>42</td>
<td>43</td>
</tr>
</tbody>
</table>
<br/>
<input type= "button" value= "Delete Row" onclick= "DeleteRow ()"/>
<input type= "button" value= "delete a column" onclick= "DeleteColumn ()"/>
</body>
<script language= "JavaScript" type= "Text/javascript" >
<!--
Get Table objects
var _table=document.getelementbyid ("Table1");
Defines a function to delete the first row
function DeleteRow () {
_table.deleterow (0);
}
Defines a function to delete the first column
function DeleteColumn () {
Deleting a column requires column deletion for each row
for (Var i=0;i<_table.rows.length;i++) {
_table.rows[i].deletecell (0);
}
}
-->
</script>