AutoFit Columns and Rows while loading HTML in Workbook

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 the Workbook without any load options and saves it in XLSX format. It then loads the sample HTML into the Workbook again, this time 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 the HtmlLoadOptions.auto_fit_cols_and_rows property on both output Excel files.

todo:image_alt_text

Sample Code