|
created() {
var actSheet = this.spreadsheetObj.getActiveSheet();
this.spreadsheetObj.autoFit(
"A:" + getColumnHeaderText(actSheet.columns.length)
); // set width for columnn based on the maximun text width.
// Set a max-width here :
for (var i = 0; i < actSheet.columns.length; i++) {
if (actSheet.columns[i].width > 500)
this.spreadsheetObj.setColWidth(500, i, 0); // set maximum width that has greater than maximum width of 500
}
} |
|
created: () => {
this.spreadsheetObj.cellFormat(
{
fontWeight: "bold",
textAlign: "center",
verticalAlign: "middle"
},
"A1:F1"
);
var actSheet = this.spreadsheetObj.getActiveSheet();
this.spreadsheetObj.autoFit(
"A:" + getColumnHeaderText(actSheet.columns.length)
); // set width for columnn based on the maximun text width.
// Set a max-width here :
for (var i = 0; i < actSheet.columns.length; i++) {
// actSheet.columns returns the columns width
if (actSheet.columns[i].width > 500)
this.spreadsheetObj.setColWidth(500, i, 0); // set maximum width that has greater than maximum width of 500
}
} |