Forum


Replies: 1   Views: 115
In html styles displaying but when we download the word ui getting broken. how to achieve this using
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by rameshsomepalli  · 30-06-2020 - 17:07

Hey,

I have created below HTML structure by using embenHTML and it was displaying fine in browser but when we download this in word UI getting distrubed .

<div style="width: 100%;border-spacing:0;display: table;">
                                <div style="background: #f5f5f5;border: 1px solid #e5e5e5;border-radius: 3px;display: table-row-group;">
                                  <div style="display: table-row">
                                    <div style="vertical-align: middle;padding-left: 25px;width: 10%;display: table-cell;">
                                      <img style="height:100px; width:100px;margin-left: 25px;" src="/images/image_excel.png" />
                                    </div>
                                    <div style="padding-left: 50pt;width: 90%;display: table-cell;">
                                      <p style="font: normal 14pt Avenir Next;color: grey;margin-bottom: 0pt;margin-top: 0pt;">ATTACHMENT</p>
                                      <p style="font: bold 18pt Avenir Next Demi Bold;margin-bottom: 0pt;margin-top: 6pt;">'.$file_title.'</p>
                                      <p style="font: normal 14pt Avenir Next Demi Bold;"><a href="'.$host_add.'" target="_blank">Download from Ramesh Platform</a></p>
                                    </div>
                                  </div>
                                </div>
                              </div>

How to achieve this by using addTable method. I have tried but no luck!

 

and also I have tried in another way like below code , it was working fine in both places but  this background

background: #f5f5f5;

color is adding to the another table type node.

<table style="width: 100%;border-spacing:0;">
                                <tbody style="background: #f5f5f5;border: 1px solid #e5e5e5;border-radius: 3px;">
                                <tr>
                                <td style="vertical-align: middle;padding-left: 25px;width: 10%;">
                                  <img style="height:100px; width:100px;margin-left: 25px;" src="/images/image_excel.png" />
                                  </td>
                                  <td style="padding-left: 50pt;width: 90%;">
                                  <p style="font: normal 14pt Avenir Next;color: grey;margin-bottom: 0pt;margin-top: 0pt;">ATTACHMENT</p>
                                  <p style="font: bold 18pt Avenir Next Demi Bold;margin-bottom: 0pt;margin-top: 6pt;">'.$file_title.'</p>
                                  <p style="font: normal 14pt Avenir Next Demi Bold;"><a href="'.$host_add.'" target="_blank">Download from Ramesh Platform</a></p>
                                  </td>
                                  </tr>
                                </tbody>
                                </table>

Can anyone share the same by using addTable method

Thanks,

Ramesh S

Posted by admin  · 30-06-2020 - 17:53

Hello,

The style table-row is not supported, you need to use a table or set parseDivs option in embedHTML to table.

For this kind of support: Can anyone share the same by using addTable method , please open a support ticket and dev team will generate a custom script: https://www.phpdocx.com/support

Regards.