Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 777267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:34:42+00:00 2026-05-14T19:34:42+00:00

It has become apparent I’m quite an idiot – there was an error in

  • 0

It has become apparent I’m quite an idiot – there was an error in my JS above this code – sorry for the bother – all the below are correct in one form or another.. (also I’m selecting the one that works in IE is the correct answer).. Thanks for all your help!!

— Representative code only – I need to know how to change the innerhtml of the tablerow —

<html>
<head>
<script> //full javascript declaration - function call after page loads..
function ()
{
document.getElementById('tr1').innerHTML='<td>Test</td>'; // does not work..
document.getElementByTagNames('tr')[0].innerHTML='<td>Test</td>'; // does not work..
document.getElementById('div2').getElementsByTagNames('tr')[0].innerHTML='<td>Test</td>'; //does not work..
document.getElementById('div1').div2.tr1.innerHTML='<td>Test</td>'; //nope
}
</script>
</head>
<body>
<div id='div1'>
    <div id='div2'>
        <table>
            <tr id='tr1'></tr>
        </table>
    </div>
</div>
</body>
</html>

Thanks for the help

Let me clarify.. I have 400 lines of HTML/JS/Jquery code being dynamically generated so I’ll simplify to the part that is a problem

This function is called when the body loads:

function loadinitialData()
{
$('#tabs').tabs();
document.getElementById('tr0').innerHTML = '<td>John Doe</td><td>3.988000</td><td>Candidate Doe</td>';
document.getElementById('tr1').innerHTML = '<td>Jane Doe</td><td>5.796000</td><td>Candidate Doe</td>';
}

This is in the body:

<div id="tabs" class="ui-corner-top"> 
            <ul> 
                <li><a href="#tabs-1">Some Idiots</a></li> 
                <li><a href="#tabs-2">Other Idiots</a></li> 
            </ul>
            <div id="tabs-1">
            <table width="590px" cellpadding="4px" rules="groups" frame="void" bordercolor="white">
            <tr><td>Name</td><td>Time Taken</td><td>Something</td></tr>
            <tbody>
            <tr style='font-size:12px' id='tr0'></tr><tr style='font-size:12px' id='tr1'></tr></tbody></table></div>
            <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div> 
</div>

PS: Using jquery tabs but that can’t be a problem..

Per @Gero I tried the following:
Changed all the loading to:

document.getElementById('tablet10').rows[0].cells[0].innerHTML = 'John Doe';
document.getElementById('tablet10').rows[0].cells[1].innerHTML ='3.988000';
document.getElementById('tablet10').rows[0].cells[2].innerHTML ='Candidate Doe';

Blah Blah – all the rest..

In the body

<div id="tabs-1"> 
            <table id="tablet10" width="590px" cellpadding="4px" rules="groups" frame="void" bordercolor="white"> 
            <tr><td>Name</td><td>Time Taken</td><td>Something</td></tr> 
            <tbody> 
            <tr style='font-size:12px'><td></td><td></td><td></td></tr><tr style='font-size:12px'><td></td><td></td><td></td></tr></tbody></table></div> 

Per @plodder loading:

document.getElementById('tr0').insertCell(0).innerHTML = 'John Doe';
document.getElementById('tr0').insertCell(1).innerHTML ='3.988000';
document.getElementById('tr0').insertCell(2).innerHTML ='Candidate Doe';

and the rest blah blah..

and body:

<div id="tabs-1"> 
            <table width="590px" cellpadding="4px" rules="groups" frame="void" bordercolor="white"> 
            <tr><td>Name</td><td>Time Taken</td><td>Something</td></tr> 
            <tbody> 
            <tr style='font-size:12px' id='tr0'></tr><tr style='font-size:12px' id='tr1'></tr></tbody></table></div> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:34:43+00:00Added an answer on May 14, 2026 at 7:34 pm

    The code will fail in IE because TR.innerHTML is not writeable in IE

    You should use the DOM API for table rows

    document.getElementById('tr1').insertCell(myCell);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone run into this error message before when using a timer on an
Elementree has become the accepted standard for interacting with xml. What is the prevalent
I've got a couple large checkouts where the .svn folder has become damaged so
My company has recently became a Microsoft Certified Partner and from a business perspective
Has anyone tried installing SQL Server 2008 Developer on a machine that already has
Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project?
Has anyone looked at Yahoo's ASTRA ? It's fairly nifty, but I had some
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone built a website with IronPython and ASP.NET. What were your experiences and
Has anyone had any success running two different web servers -- such as Apache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.