Closed Bug 310661 Opened 19 years ago Closed 19 years ago

table.insertRow(0) does not appear to produce an error, but has no visible effect

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 264412

People

(Reporter: steve.teale, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.7.12) Gecko/20050919 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.7.12) Gecko/20050919 Firefox/1.0.7

<html>
<head>
<script>
function insrow()
{
   var table = document.getElementById("thetable");
   var row = table.insertRow(0);
   var cell = row.insertCell(0);
   cell.innerText = "XXX";
   cell = row.insertCell(1);
   cell.innerText = "YYY";
   alert("OK");
}
</script>
</head>
<body>
<form>
<button onclick="insrow()">Go</button>
<table id=thetable width=300>
<tbody>
</tbody>
</table>
</form>
</body>
</html>

Reproducible: Always

Steps to Reproduce:
1.Create an html file from the text in details
2.Load it File -> Open File
3.Click the Go button

Actual Results:  
The alert "OK" was displayed, but no table row.  Works fine in IE6.

Expected Results:  
I expect to see a row:

XXX    YYY

*** This bug has been marked as a duplicate of 157578 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
I'm sorry for bug spams.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Using appendChild and createTextNode causes it to work.  innerText is not
supported.  search on Bugzilla for 'innerText', or search for 'innerText' here:


http://www.mozilla.org/docs/web-developer/upgrade_2.html#dom_unsupp

*** This bug has been marked as a duplicate of 264412 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → DUPLICATE
(In reply to comment #3)
innerHTML works as well.

<html>
  <head>
    <script type="text/javascript">
function insrow()
{
   var table = document.getElementById("thetable");
   var row = table.insertRow(0);
   var cell = row.insertCell(0);
   cell.innerHTML = "XXX";
}
    </script>
  </head>
  <body>
    <a href="javascript:insrow()">Go</a>
    <table id="thetable" width="300">
      <tbody>
      </tbody>
    </table>
  </body>
</html>
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: