Function parseHtmlTable

  • The cell texts of the first <table> in clipboard HTML (Excel, Google Sheets). Parsed with DOMParser into an inert document – no element of it is ever put into the page, no script runs, images do not load; only the text of the cells is read (<br> = line break, colspan = empty cells, scripts and styles left out). Without a table or without DOMParser: [].

    Parameters

    • html: string

      the text/html content

    Returns string[][]

    rows of cell texts, all of the same length

    Example

    parseHtmlTable("<table><tr><td>a</td><td>1</td></tr></table>");   // [["a", "1"]]
    

    Since

    1.1.99