DeleteRow(), deleteCell() i rowIndex
deleteRow( ), deleteCell( ) i rowIndex - deleteRow briše red u tabeli,
a deleteCell briše ćeliju. RowIndex vraća indeks reda u tabeli. Analogno tome
cellIndex vraća indeks ćelije u redu. Evo primera:
<html><head>
<script type="text/javascript">
function brisiCeliju(){
document.getElementById("tr2").deleteCell(1);
}
function brisiRed(r){
i = r.parentNode.parentNode.rowIndex
document.getElementById("tabla").deleteRow(i);
}
</script></head><body>
<table id="tabla" border="1">
<tr id="tr1">
<td>Red 1</td><td>Red 1</td>
<td><input type="button" value="Izbrisi red"
onclick=brisiRed(this)></td>
</tr><tr id="tr2">
<td>Red 2</td><td>Ova celija se brise</td>
<td><input type="button" value="Izbrisi celiju"
onclick=brisiCeliju()></td>
</tr>
</table></body></html>