Thanks for the screen shot and some details.
Please try our latest version/ fix: Aspose.Cells for .NET v188.8.131.52
I have evaluated your scenario/ case a bit. I used a simple template file (attached) with the following sample code, it works fine. I generated both XLSX and HTML files, both are fine. I have attached the output HTML file in the attached archive for your reference:
Workbook workbook = new Workbook(“e:\test2\Bkbordermerge.xlsx”);
Worksheet worksheet = workbook.Worksheets;
//Formatting cells and ranges.
//Creating a range that spans over the all data cells of a worksheet
var range = worksheet.Cells.CreateRange(“B3”, “E6”);
//Create a Style object.
Style colstyle = workbook.CreateStyle();
colstyle.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
colstyle.HorizontalAlignment = TextAlignmentType.Center;
StyleFlag flag = new StyleFlag();
flag.Borders = true;
//Apply the style to the range
If you still find the issue with v184.108.40.206, I am afraid, we need a simple console application (runnable) with your template file(s) (if there is any) to reproduce the issue on our end. We will check it soon.