Forum How do I...?

document.inserRow not supported?

bamofa
Hello,
Am playing around with some javascript examples for W3school:

function fnCreateTable(){
    
    // Find a <table> element with id="myTable":
    var table = document.getElementById("myTable");

    // Create an empty <tr> element and add it to the 1st position of the table:
    var row = table.insertRow(0); 

    // Insert new cells (<td> elements) at the 1st and 2nd position of the "new" <tr> element:
    var cell1 = row.insertCell(0);
    var cell2 = row.insertCell(1);

    // Add some text to the new cells:
    cell1.innerHTML = "NEW CELL1";
    cell2.innerHTML = "NEW CELL2";
}

when i try and convert the html with the following function prince gives me a TyeError: null value is not an object. the line its highlighting is var row = table.inserRow();

Would greatly appreciate any help with this.

mikeday
Prince does not support the insertRow and insertCell methods, so you will need to use appendChild or insertBefore instead.
bamofa
Thanks for the reply. Is this a feature that you will never support or is this something that is being considered?

Thanks,
mikeday
We may support it in the future, but it is lower priority than other features, as its behaviour can be simulated with other JavaScript.
bamofa
awesome thanks