ZVON > References > DOM2 Reference

deleteCell (method )

Owning interface and usage:  
HTMLTableRowElement.deleteCell(index)

Member of these other interfaces:  
none

Description:  
Delete a cell from the current row.

Parameters:  
long index  -  The index of the cell to delete, starting from 0. If the index is -1 the last cell in the row is deleted.

Returns:  
nothing

Exceptions:  
DOMException INDEX_SIZE_ERR
Raised if the specified index is greater than or equal to the number of cells or if the index is a negative number other than -1.


Example:
Source:
  <TABLE id="testTable" border="1">
    <TR>
      <TD>cell 1</TD>
      <TD>cell 2</TD>
      <TD>cell 3</TD>
    </TR>
  </TABLE>
JavaScript:
  function deleteCellOnTableRow() {
    var main = document.getElementById('testTable');
    var row = main.rows.item(0);
    row.deleteCell(1);
  }
Try it:  
See it:
cell 1 cell 2 cell 3



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
UNLIMITED Web Hosting by HostDepartment Alojamiento Web UK Domain Names glossary for conference call answering service
MSN VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE