Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

HTML Rendering – Convert Tabbed String to Html Table

Converts a tab-delimited string into an HTML table.

This function parses the tabbed string into rows and columns and generates HTML markup accordingly. If firstRowIsHeader is set to True, the first row is wrapped in <thead> and <th> tags.

VB
      Public Function ConvertTabbedString2HtmlTable(TabbedString As String, 
                               Optional ByVal firstRowIsHeader As Boolean = True) As String

        Dim arRecords As String() = TabbedString.Split(New String() {vbCrLf}, StringSplitOptions.RemoveEmptyEntries)
        Dim szToReturn As String = String.Empty

        Try
            For Each szRecord In arRecords

                Dim arFields As String() = szRecord.Split(vbTab)

                If firstRowIsHeader Then
                    szToReturn += "<thead><tr>" + vbCrLf
                    For Each szField In arFields
                        szToReturn += "<th>" + szField + "</th>"
                    Next
                    szToReturn += "</tr></thead>" + vbCrLf
                    firstRowIsHeader = False
                Else
                    szToReturn += "<tr>"
                    For Each szField In arFields
                        szToReturn += "<td>" + szField + "</td>"
                    Next
                    szToReturn += "</tr>" + vbCrLf
                End If

            Next

        Catch ex As Exception
        End Try

        szToReturn = "<table>" + vbCrLf + szToReturn + "</table>"
        Return szToReturn
    End Function

Posted by ipercube


© 2026 Ipercube Design