Jump to content

table adds rows in all browsers except for Internet Explorer


carlbrooks

Recommended Posts

Hi,

 

I have a function where it add rows into a table. For the example below it adds a row under the Question column, (I have not included whole function as there is a lot of code so instead I have just posted the relevant code.

 

//This is inside a function

var row = document.createElement("tr");
var cell
        input,
        alertErrors = "",
        // Note, this is just so it's declared...
        qnum = 1;

cell = document.createElement("td"),
        input = document.createElement("textarea");
    cell.className = "question";
    input.name = "question_" + qnum;
    input.value = form.questionText.value;
    cell.appendChild(input);
    row.appendChild(cell); 

 

Now my function works really well when it comes to adding a row into a table. The problem is that it works on all major browsers except for Internet Explorer. I have researched an found out that I may need to use insertRow() and insertCell() methods. I don't know how to really apply this into my code so what I want to know is that if somebody knows how to manipulate the code above to include the insertRows and insertCell methods, then can you please do this for the code above. It means I know how insertRow() and insertCell is added in the code and I can include this in all of my other columns in the function.

 

Thank You :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.