plutext / docx4j-ImportXHTML

Converts XHTML to OpenXML WordML (docx) using docx4j
135 stars 124 forks source link

(HTML To Docx) Convert html table loses css style when I use the style border-collapse: collapse; #77

Open AchrafLakhdhar opened 2 years ago

AchrafLakhdhar commented 2 years ago

Hi, I'm using docx4j-ImportXHTML 8.2.1 and I'm trying to convert a html table to a docx document, but the css inline style and the html property "border" does not remain when I use the property "border-collapse: collapse;"

This is an example when I use "border-collapse: collapse;"

<table width="100%" border="5" style="border-collapse: collapse;" >
  <tr>
    <td>Test Table Cell 1</td>
  </tr>
</table>

The docx result is : collapse

However when I use border-collapse: separate, the border and the style is well formatted

<table width="100%" border="5" style="border-collapse: separate;" >
  <tr>
    <td>Test Table Cell 1</td>
  </tr>
</table>

separate

Thank you very much in advance!