Search code examples
javascripthtmlhtml-tablexlsxtabulator

Remove <br> from column headers in tabulator xlsx export


I am using Tabulator as frontend table framework in my browser. Some of my columns have long titles and are splitted by html line breaks (<br>).

When I download the table data in Excel file format, my column headers (= first row in this spreadsheet export) contain those <br> as plain text, e.g.: Foo<br>bar.

How can I remove these characters in my excel export? Is this even possible? Any ideas?

EDIT

Here a screenshot from my Excel export for clarification: Tabulator Column Headers in Excel


Solution

  • You can specify the title you want to be substituted for in the download here Download Title as:

    columns: [
        { title: "Name", field: "name", titleDownload: "Full Name" } //change column title to "Full Name" in download
    ]
    

    If you really want to customize things you build your own custom file formatter Custom Format.