PRB: Error Setting table.innerHTML in Internet Explorer

Article translations Article translations
Article ID: 239832 - View products that this article applies to.
This article was previously published under Q239832
Expand all | Collapse all

Symptoms

Setting table.innerHTML causes the following error message to appear:
Unknown runtime error

Cause

The innerHTML property of the TABLE, TFOOT, THEAD, and TR elements are read-only.

Resolution

To change the contents of these table elements, use the table object model or Document Object Model (DOM).

Status

This behavior is by design.

More information

Use the rowIndex property or the rows collection to retrieve a reference to a specific table row. You can add or delete rows using the insertRow and deleteRow methods.

To retrieve a reference to a specific cell, use the cellIndex property or the cells collection. You can add or delete cells using the insertCell and deleteCell methods. To change the content of a particular cell, use the innerHTML property.

More options are available by using methods of the DOM. You can use the createElement method to create elements for the table and then the other DOM methods and properties (such as insertBefore, swapNode, and so forth), which are available to modify the table contents.

References

For more information on building tables dynamically see the following article on the MSDN Web Workshop:
Building Tables Dynamically

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
http://msdn.microsoft.com/ie/

http://support.microsoft.com/iep

Properties

Article ID: 239832 - Last Review: August 31, 2012 - Revision: 3.0
Applies to
  • Microsoft Internet Explorer 4.01 Service Pack 1
Keywords: 
kbdhtml kbprb KB239832
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com