You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is rather a feature request. Looking at the documentation, i have been unable to find how to either change the style of an element already created, or delete it to replace it, which creates difficulties in updating existing document rather than creating them from scratch. Forcefully editing the style breaks the document.
Expected Behavior
Locally, i added in \phpoffice\phpword\src\PhpWord\Element\Cell.php :
There seems to be no public methods to set the style of existing elements, nor there is any to delete elements of containers. I'm looking for advices as how to develop these new features. Bellow details of the unexpected result of the code :
Failure Information
None errors are raised, however the document (.docx) written is broken at the location of the table whose cell styles were edited.
The last page is not displayed.
Without calling the custom made setStyle function:
How to Reproduce
Add the above code to the Cell class and call it. Save the written document under .docx.
Context
PHP version: 7.1.8
PHPWord version: 0.14
The text was updated successfully, but these errors were encountered:
I only modified background color on style so maybe one style is causing the problem... @captixn could you tell me which styles were you setting? I'm creating a new document but need to create all table cells before... It seems you are loading a document, isn't it?
This is rather a feature request. Looking at the documentation, i have been unable to find how to either change the style of an element already created, or delete it to replace it, which creates difficulties in updating existing document rather than creating them from scratch. Forcefully editing the style breaks the document.
Expected Behavior
Locally, i added in \phpoffice\phpword\src\PhpWord\Element\Cell.php :
And call it from an object. I expect the function to set the style when I passe an array such as
Current Behavior
There seems to be no public methods to set the style of existing elements, nor there is any to delete elements of containers. I'm looking for advices as how to develop these new features. Bellow details of the unexpected result of the code :
Failure Information
None errors are raised, however the document (.docx) written is broken at the location of the table whose cell styles were edited.
The last page is not displayed.
Without calling the custom made setStyle function:

How to Reproduce
Add the above code to the Cell class and call it. Save the written document under .docx.
Context
The text was updated successfully, but these errors were encountered: