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

Putting a div inside a table cell (td) will result in an indentation if the cell, table, body or html parent elements does not have padding, margin set to 0 #73

Open
amer1993 opened this issue Feb 7, 2021 · 0 comments

Comments

@amer1993
Copy link

amer1993 commented Feb 7, 2021

Hi,

The following HTML

<table><tr><td>Value 1</td></tr><tr><td><div>Value 2</div></td></tr></table>

will result to an indentation for Value 2 where it should not.

I solved this by putting padding 0 to the parent box elements

e.g:
<table><tr><td style=\"padding: 0;\">Value 1</td></tr><tr><td style=\"padding: 0;\"><div>Value 2</div></td></tr></table>

By debugging, I found the responsible code that should resolve this issue is commented out:

/* && !(o instanceof org.docx4j.org.xhtmlrenderer.newtable.TableCellBox) */ // need to stop if we encounter a table cell?

What is the problem with having this code uncommented?

Thanks in advance.

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

1 participant