Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting xHTML to docx doesn't keep table width #559

Open
7amou opened this issue Sep 27, 2023 · 1 comment
Open

Converting xHTML to docx doesn't keep table width #559

7amou opened this issue Sep 27, 2023 · 1 comment

Comments

@7amou
Copy link

7amou commented Sep 27, 2023

When converting xhtml to word with docx4j with tables that are set with a width of 50% (for example), the doc generated do not respect this width, and the same goes for the cells.
Code snippet from the html :
<p>50%, border 1 et width: 50%; border-collapse: collapse; et pour chaque cellule width: 33.3333%</p> <table border="1" cellspacing="0" style="border-collapse: collapse;" width="50%"> <tbody> <tr> <td width="33.3333%">Kilométrage au sinistre</td> <td width="33.3333%">Prise en charge de l&#39;intervention au titre du Contrat</td> <td width="33.3333%">Montant restant à votre charge</td> </tr> <tr> <td width="33.3333%"></td> <td width="33.3333%"></td> <td width="33.3333%"></td> </tr> <tr> <td width="33.3333%"></td> <td width="33.3333%"></td> <td width="33.3333%"></td> </tr> </tbody> </table>
The generated table :
image
I don't know what I am missing, everything goes well when the width is at 100% for the table tag, and I saw that the width acts like a threshold, it will generate a 100% width if the value was >50%, approximately 75% generated if the value is 50% and 50% generated for <50%.
Do you know what is wrong with the way we style our tables ?
Thanks

@plutext
Copy link
Owner

plutext commented Feb 27, 2024

Wrong project, please report instead at https://github.com/plutext/docx4j-ImportXHTML/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants