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

Attribute align and margin: auto don't work #171

Closed
methalox opened this issue Oct 22, 2024 · 3 comments
Closed

Attribute align and margin: auto don't work #171

methalox opened this issue Oct 22, 2024 · 3 comments

Comments

@methalox
Copy link

It doesn't align the element when parsing its "align" attribute.

<p align="center">example</p>

Also, images don't get centered when using margin auto.

<p><img style="display: block; margin-left: auto; margin-right: auto;" src="/images/example.png" width="310" height="220"></p>.

@onizet
Copy link
Owner

onizet commented Oct 22, 2024

Hi @methalox, align is for table. Use text-align instead.

I'm aware that margin auto doesn't work but please remember that Html layout is far more powerful than what OpenXml can provide. I will put it in my investigation list but with no garantee of success.

@methalox
Copy link
Author

@onizet Thanks. I noticed it because the html I'm working with is generated by a TinyMCE 6.0 text editor, and when you align an image it does it with margin auto.

@methalox
Copy link
Author

methalox commented Oct 22, 2024

Also sometimes it aligns the paragraphs with the align attribute, but it appears to be deprecated: https://www.geeksforgeeks.org/html-p-align-attribute/

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