AutoFit Columns and Rows while loading HTML in Workbook
Contents
[
Hide
]
Possible Usage Scenarios
You can autofit columns and rows while loading your HTML file inside the Workbook object. Please set the HtmlLoadOptions.auto_fit_cols_and_rows property to true for this purpose.
AutoFit Columns and Rows while loading HTML in Workbook
The following sample code first loads the sample HTML into Workbook without any load options and saves it in XLSX format. It then again loads the sample HTML into Workbook but this time, it loads the HTML after setting the HtmlLoadOptions.auto_fit_cols_and_rows property to true and saves it in XLSX format. Please download both the output excel files i.e.Output Excel File Without AutoFitColsAndRows and Output Excel File With AutoFitColsAndRows. The following screenshot shows the effect of HtmlLoadOptions.auto_fit_cols_and_rows property on both output excel files.