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

Set table, column width #2

Closed
danilcostefanovski opened this issue Jun 10, 2020 · 7 comments
Closed

Set table, column width #2

danilcostefanovski opened this issue Jun 10, 2020 · 7 comments
Assignees

Comments

@danilcostefanovski
Copy link

danilcostefanovski commented Jun 10, 2020

@privateOmega Can you please explain how to set (table and column), div width in html to affect changes on docx.

@privateOmega
Copy link
Owner

@danilcostefanovski Thanks for showing interest in this library.

Library takes into account width from html table's style property. eg <table border="1" style="width:150px;"><tr><td>sample text</td></tr></table>. Checkout v1.1.11 if you were using any previous versions.

For now, column width isn't supported, but I will try to add support for them as soon as possible, but for now if you require uneven cell sizing, I guess maybe you can try out colspan which is supported, else all columns will have equal width.

And sorry to be saying this, but div isn't a topic something that I have solved as of now. So none of the css you have set on div would take effect ATM.

@privateOmega privateOmega self-assigned this Jun 11, 2020
@amrita-syn
Copy link
Collaborator

The latest changes might mitigate the need to set column width altogether. Looks spacier now.

@privateOmega
Copy link
Owner

@amrita-syn This is something that totally skipped my mind, and will be adding support for it soon. With your latest PR, we now have table min-width also handled.

@amrita-syn
Copy link
Collaborator

Column (td level) widths are now supported by adding style="...; width: 25%; ..." to the td elements. Closing issue.

@capturingnoise
Copy link

Column (td level) widths are now supported by adding style="...; width: 25%; ..." to the td elements. Closing issue.

I can't for the life of me get td: width to work with the latest release. The resulting docx just gives two 50% columns.

Here's my code:

<table style="text-align: left; border:0px solid white; width: 100%; table-layout: fixed"> <tr style="border: 0px;"> <td style="border: 0px; width: 40%"> <p>Some Text Here</p> </td> <td style="border: 0px; width: 40%"> <p>some more text</p> </td> </tr> </table>

@betaWeb
Copy link

betaWeb commented Dec 8, 2021

Same problem here : the width of td elements is not taken into account and the resulting docx just gives two 50% columns...

@amrita-syn
Copy link
Collaborator

Same problem here : the width of td elements is not taken into account and the resulting docx just gives two 50% columns...

To be addressed in #105

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

5 participants