Worksheet to HTML invalid column width

Hello,
I’m trying to export an Excel Worksheet to HTML but after checkin the output I don’t find the correct width of the columns (“Width” without the unit and style with “Width” in pt)
Could you explain me if I’m using the wrong method ?

Code:
Workbook wrk = new Workbook(@“C:\test\Book1.xlsx”);

using (var stream = new MemoryStream(1))
{
var opts = new Aspose.Cells.HtmlSaveOptions
{
ExportGridLines = false,
ExportActiveWorksheetOnly = true,
HtmlCrossStringType = HtmlCrossType.MSExport,
ExportBogusRowData = false,
ExportImagesAsBase64 = true,
ExportCellCoordinate = true
};
wrk.Save(stream, opts);

byte[] arr = stream.ToArray();
var html = Encoding.UTF8.GetString(arr);

}

Console.WriteLine(“Column 3”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidth(3)}”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidthPixel(3)}”);

Console.WriteLine(“Column 4”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidth(4)}”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidthPixel(4)}”);

Console.WriteLine(“Column 5”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidth(5)}”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidthPixel(5)}”);

Console.WriteLine(“Column 6”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidth(6)}”);
Console.WriteLine($“Width {wrk.Worksheets[0].Cells.GetColumnWidthPixel(6)}”);

Console results:

Column 3
Width 9,38
Width 80 → PX

Column 4
Width 14,38
Width 120 → PX

Column 5
Width 6,88
Width 60 → PX

Column 6
Width 19,38
Width 160 → PX

HTML:

image.png (54.7 KB)

Why the table width is also not correct ?

Thanks

Regards
Davide
Book1.zip (7.7 KB)

One more clarification; if I try to add this HTML in a Word document the columns does not have the correct width as Excel

Code:
var builder = new Aspose.Words.DocumentBuilder(doc);
builder.InsertHtml(html);

Thanks
Davide

@davidepedrocca,

Thanks for the sample file and screenshot.

We need to evaluate your issue in details. We will try to figure it out soon. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-54901

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@davidepedrocca
Aspose.Cells follows MS Excel-related formats. If you export your file through MS Excel to an HTML file, you will also get similar results.
html-excel.png (12.3 KB)

@davidepedrocca ,

“if I try to add this HTML in a Word document the columns does not have the correct width as Excel”,
The width in word should be compared with the width in html. You may pelease create relative issue on the Word forum.