I am using Tabulator as frontend table framework. When I download the table data in Excel file format, my columns have default size. Is it possible to set the width of columns in xls file? I need the columns to be the same size as in the table in the browser.
I found a solution how to set column widths using sheetjs
table1.download("xlsx", "data.xlsx", {
documentProcessing: function(workbook) {
var ws_name = workbook.SheetNames[0];
var ws = workbook.Sheets[ws_name];
// setting column with in characters (use wpx for pixels)
var wscols = [
{wch:60},
{wch:7},
{wch:10},
{wch:200}
];
ws['!cols'] = wscols;
return workbook;
},
});