Help and Support

PRB: Error Setting table.innerHTML in Internet Explorer

Article ID:239832
Last Review:May 11, 2006
Revision:2.0
This article was previously published under Q239832

SYMPTOMS

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

Back to the top

CAUSE

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

Back to the top

RESOLUTION

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

Back to the top

STATUS

This behavior is by design.

Back to the top

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.

Back to the top

REFERENCES

For more information on building tables dynamically see the following article on the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/author/tables/BuildTables.asp (http://msdn.microsoft.com/workshop/author/tables/BuildTables.asp)
For more information on the Document Object Model see the DOM Overview article on the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/author/dom/domoverview.asp (http://msdn.microsoft.com/workshop/author/dom/domoverview.asp)

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

http://support.microsoft.com/iep (http://support.microsoft.com/iep)

Back to the top


APPLIES TO
Microsoft Internet Explorer 4.0 128-Bit Edition
Microsoft Internet Explorer 4.01 Service Pack 2
Microsoft Internet Explorer 4.01 Service Pack 1
Microsoft Internet Explorer 5.0

Back to the top

Keywords: 
kbdhtml kbprb KB239832

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.