HTMLTableRow - cloneNode, replacing innerHTML resulting in missing <TD> ???

Iam trying to copy an original row with some tag information, then replace these tags with information from my database
The code below is actually working quite good however doing the newRow.innerHTML = newRow.innerHTML (should do nothing) results in the starting <TD> missing
Meaning you get a bad looking table
Does anyone know another way of doing this or what iam doing wrong ?
Additionally i would like a way to delete the originalRow from the html document...

        Dim originalRow As HTMLTableRow
        Dim newRow As HTMLTableRow
        Set originalRow = dd.getElementById("indLinie")
        salg_db.Open "SELECT * From betalinger", frmFront.registerCnxn, adOpenForwardOnly, adLockReadOnly
        While Not salg_db.EOF
            Set newRow = originalRow.cloneNode(True)
            If salg_db!type = 0 Then
                newRow.innerHTML = Replace(Replace(Replace(newRow.innerHTML, "[RegnNavn]", salg_db!tekst), "[RegnBelob]", FormatCurrency(salg_db!tal)), "[Type]", "Indb.")
                newRow.innerHTML = Replace(Replace(Replace(newRow.innerHTML, "[RegnNavn]", salg_db!tekst), "[RegnBelob]", FormatCurrency(salg_db!tal)), "[Type]", "Udb.")
            End If
            Call originalRow.appendChild(newRow)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leo EikelmanDirector, IT and Business DevelopmentCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I've reproduced your problem and it's rather strange. I tried using the specific table functions from the link above and it did not help either, but maybe because I was missing some additional elements.

This was what I managed and it may help you. A bit sloppy, I know.

    Dim o_doc As HTMLDocument
    Dim o_tbl As HTMLTable
    Dim o_row As HTMLTableRow
    Dim o_rowNew As HTMLTableRow
    Dim o_rowCell As HTMLTableCell
    'get initial elements
    Set o_doc = WebBrowser1.Document
    Set o_row = o_doc.getElementById("row1")
    Set o_tbl = o_row.parentElement.parentElement
    'create new row and cell
    Set o_rowNew = o_doc.createElement("tr")
    Set o_rowCell = o_doc.createElement("td")
    'assign content to the cell and append it to the row
    o_rowCell.innerHTML = "testing"
    Call o_rowNew.appendChild(o_rowCell)
    'insert the new row before the old one and remove the old one
    Call o_row.insertAdjacentElement("beforeBegin", o_rowNew)
    Call o_row.parentNode.removeChild(o_row)

mSchmidtAuthor Commented:
I have managed to get it working using the following code.. it seems that innerHTML should only be used on HTMLTableCells

        Set originalRow = dd.getElementById("udLinie")
        For Each ahv In dDagsInfo.udbetalingCol
            Set newRow = originalRow.cloneNode(True)
            For Each newCell In newRow.childNodes
                newCell.innerHTML = Replace(Replace(Replace(newCell.innerHTML, "[RegnNavn]", ahv.vareNavn), "[RegnBelob]", FormatCurrency(ahv.vareTotal)), "[Type]", "Indb.")
            Call originalRow.insertAdjacentElement("afterEnd", newRow)
        Call originalRow.parentElement.removeChild(originalRow)

Thanks for you help though
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.