Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How can I add more columns and rows in this table?

Screen of HTML

Hello, I try to add more columns and rows with Javascript in this table but it didn't work. Can you help me?

function asttabel() {
    try {
        var table = document.getElementsByClassName("awsui-table-selection-area");
        if (table == undefined){
            setTimeout(asttabel, TIMEOUT);
        } else {            
            var rows = table.tBodies[0].rows;
            if (rows.length == 0){
                setTimeout(waitForTable, TIMEOUT);
                return;
                var theader = table.tHead.rows[0];    
                var newItem = document.createElement("th");
                var textnode = document.createTextNode("LPN/FNSku");
                newItem.appendChild(textnode);
                theader.insertBefore(newItem, theader.childNodes[index]);
                for (var i = 0; i < rows.length; i++){
                    var newItem = document.createElement("td");
                    var textnode = document.createTextNode("lade...");
                    newItem.appendChild(textnode);
                    rows[i].insertBefore(newItem, rows[i].childNodes[index]);
                }


    }catch(err){
        console.log(err.message);
    }
}

Comments