ANmaHTMLTables_Combine2

Combine strings of two HTML tables into string of one table.

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ANmaHTMLTables_Combine2(Table1, Table2)
    ' Combine two HTML tables into one
    '
    ' Remove </table at end of table1
    ' Remove <table ... at start of table2
    '    Then do the same for </tbody and <tbody
    ' Then merge and return
    '
    ' Needs CutString, VBInstr
    Rett = ""
    Table_1 = Table1
    Table_2 = Table2
    Table_1 = CutString(Table_1, , " </table")
    Table_1 = CutString(Table_1, , " </tbody")
    Table_2 = CutString(Table_2, " >", , VBInstr(" <table ", Table_2) + 1)
    If VBInstr(" <tbody", Table_2) > 0 Then
        Table_2 = CutString(Table_2, " >", , VBInstr(" <tbody", Table_2) + 1) ' Remove tbody if found
    End If
    Rett = Table_1 & vbCrLf & vbCrLf & Table_2
    ANmaHTMLTables_Combine2 = Rett
End Function

Table1, Table2

Views 310

Downloads 74

CodeID
DB ID

ANmarAmdeen
626
Attachments
Revisions

v1.0

Thursday
May
16
2024