We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

InsertHTML / table style : borders inconsistently applied


We use insertHTML() to insert tables in Aspose documents.

elements contain a "class" attribute to apply table styles, defined in a Word template.
Here is the Java code (see the attached file "model_aspose.dot" for the template) :

public void Merged_Document_Contains_Table_Style throws Exception {
com.aspose.words.Document doc = new com.aspose.words.Document();
DocumentBuilder builder = new DocumentBuilder(doc);
String html = ""
+ ""
+ ""
+ ".table-style {}"
+ ""
+ ""
+ ""
+ "
+ ""
+ ""
+ ""
+ ""
+ ""
+ ""
+ "
Table header 1
Table header 2
Table content
Table footer
+ "";
builder.insertHtml(html, true);

In the saved DOC file, for the header rows :
  1. they are correctly shaded,
  2. the borders exist and are correctly colored but are space-separated from the adjoining cells.
For the other rows
  1. the left column has borders and the borders are correctly colored, the right column doesn't have any borders when they should.
In the saved PDF file, there is no style whatsoever.

Could you please fix these issues ?

Thanks in advance.
Nick Harding

Hi Nick,

Thanks for your inquiry.
I have tested the scenario and have managed to reproduce the same
issues at my side. For the sake of correction, I have logged these
problems in our issue tracking system as follow:

WORDSNET-12251 : table style issue using InsertHTML : borders inconsistently applied
WORDSNET-12252 : table style is not applied in output Pdf using InsertHTML

have linked this forum thread to the same issues and you will be
notified via this forum thread once these issues are resolved.

We apologize for your inconvenience.