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

  • Home
  • SEARCH
  • 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 696547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:04:29+00:00 2026-05-14T03:04:29+00:00

A bit weird… …if running in IE8 quirks mode or in compatibility view mode,

  • 0

A bit weird… …if running in IE8 quirks mode or in compatibility view mode, the table added by the following code doesn’t render. Can anyone tell me why, because it is not obvious to me..?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function AddTable()
{
  var table = document.createElement('table');
  var row = document.createElement('tr');
  table.appendChild(row);
  var cell = document.createElement('td');
  cell.innerHTML='abc';
  row.appendChild(cell);
  var divContainer = document.getElementById('divContainer');
  divContainer.appendChild(table);
}
</script>
</head>
<body>
<div id='divContainer'>
</div>
<input type='button' value='add table' onclick='javascript:AddTable()' />
</body>
</html>
  • 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-14T03:04:29+00:00Added an answer on May 14, 2026 at 3:04 am

    Microsoft has a page that may illuminate what’s going on.

    http://msdn.microsoft.com/en-us/library/ms532998(VS.85).aspx#TOM_Create

    For dynamically building tables they advocate the “Table Object Model”, which uses methods like insertRow() and insertCell() to do the job you’re doing with the DOM methodscreateElement() and appendChild(). It’s also OK if you use the DOM methods, but “Internet Explorer requires that you create a tBody element and insert it into the table when using the DOM. Since you are manipulating the document tree directly, Internet Explorer does not create the tBody, which is automatically implied when using HTML.”

    The table object model works in the couple of browsers I tested it in (Chrome and Firefox on the Mac), so it may not be a bad idea to familiarize yourself with it. Or if you want to stick with the DOM methods, add the tBody element, because IE requires it.

    If you add the following code to the end of your AddTable() method you’ll see how the two compare (mainly, the second table will have a tBody in it). And it will render in IE8.

     // now the Table Object Model way
      table = document.createElement('table');
      row = table.insertRow(-1) ;
      cell = row.insertCell(-1) ;
      cell.innerHTML='def';
      divContainer.appendChild(table);
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into something a bit weird with the hexl-mode under Emacs (GNU Emacs
This question may sound a bit weird/novice/stupid. Please bear with me. The below code
It may sound a bit weird, but in Bukkit (Minecraft Server) there's a permissions
This might seem a bit weird, but since I am new in RoR and
I know the question sound's a bit weird. Let me explain the situation: I
Today I ran into something a bit weird. I used mini-profiler to see the
I know the title is a bit weird, but I was unable to think
My VS 2008 seems to be acting a bit weird and the solution is
all. I'm having a bit of weird problem with client server program. I have
Bit of a weird glitch here. The tag name of a childNode is logged

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.