Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Generating an HTML file from a spreadsheet is very common. The size of the columns is defined in points (“pt”), which works in many cases. However, there are situations where this fixed size may not be suitable. For example, if a container panel in which the HTML page is displayed has a width of 600 px, you may get a horizontal scrollbar if the generated table width is larger. It is required that this fixed size be changed to a scalable unit such as em or percent to achieve better presentation. The following sample code can be used, where HtmlSaveOptions.getWidthScalable() is set to true to create scalable width.
Sample source file and output files can be downloaded from the following links:
outsampleForScalableColumns.zip
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Load sample source file
const dataDir = path.join(__dirname, "data");
const sourceFilePath = path.join(dataDir, "sampleForScalableColumns.xlsx");
const workbook = new AsposeCells.Workbook(sourceFilePath);
// Specify Html Save Options
const options = new AsposeCells.HtmlSaveOptions();
// Set the property for scalable width
options.setWidthScalable(true);
// Specify image save format
options.setExportImagesAsBase64(true);
// Save the workbook in Html format with specified Html Save Options
const outputFilePath = path.join(dataDir, "outsampleForScalableColumns.html");
workbook.save(outputFilePath, options);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.