Regarding WORDSNET-16960, we do not see any HTML-related bugs here. Aspose.Words produces a document that is closer to the original HTML than the document generated by MS Word. In MS Word’s generated document we see the following defects:
- Left table border width is too narrow, meaning that the “border-left-width: 20pt” style is imported incorrectly.
- Text in the table is white instead of black.
- Text in the first row is centered, while in browsers it is left-aligned.
Regarding the “.table1” class formatting, neither Aspose.Words, nor MS Word apply it to the imported table as a table style. Instead, both programs apply table formatting directly. The “table1” style created by MS Word on import is a paragraph style that cannot be applied (and is not applied in fact) to a table, and it is never used in the resulting document.
As far as we understand, you are not happy with the fact that table-wide formatting is applied directly, not via a table style. This happens because table style management is not yet implemented in Aspose.Words and we cannot work with table styles until the dependent issues WORDSNET-5312 and WORDSNET-9641 are resolved. Until then, you should also use paragraph styles or direct formatting when working with tables:
<table style="background-color: blue; font-size: 20pt; text-align: right">
<td>Row 1, Cell 1 Content.</td>
var builder = new DocumentBuilder();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.Font.Size = 20;
builder.Font.Color = Color.Black;
builder.CellFormat.Shading.BackgroundPatternColor = Color.Blue;
var table = builder.StartTable();
builder.Write("Row 1, Cell 1 Content.");
The implementation of this issue has been postponed until the issues (WORDSNET-16960 depends upon) are resolved and Aspose.Words can work with table styles.