Forum


Replies: 4   Views: 1389
Table merges into unworkable
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 Simon87  · 13-12-2019 - 13:09

We have an html table on album oriented list that completely messes up on the width of some columns. Problem is that some of them a readable, others smashed into 1 line: https://www.dropbox.com/s/6o1bmx2vqooqhjy/slack_elqwah8uin.png?dl=0

HTML code:

<table border="1" cellpadding="1" cellspacing="1">
    <tbody>
        <tr>
            <td colspan="1">№ п/п</td>
            <td colspan="1">Ðаименование мероприÑтиÑ</td>
            <td colspan="2" rowspan="1">Год начала реализации мероприÑтиÑ</td>
            <td colspan="2" rowspan="1">Год Ð¾ÐºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ð¸ мероприÑтиÑ</td>
            <td colspan="2" rowspan="1">СтоимоÑÑ‚ÑŒ мероприÑтий, млн. руб (Ñ ÐДС)</td>
            <td colspan="1">Примечание</td>
        </tr>
        <tr>
            <td colspan="1"> </td>
            <td colspan="1"> </td>
            <td>план</td>
            <td>факт</td>
            <td>план</td>
            <td>факт</td>
            <td>план</td>
            <td>факт</td>
            <td colspan="1"> </td>
        </tr>
        <tr>
            <td>1</td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td>в ÑоответÑтвии Ñ Ð¸Ð½Ð²ÐµÑтиционной программой КонцеÑÑионера</td>
            <td> </td>
            <td> </td>
        </tr>
        <tr>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
            <td> </td>
        </tr>
        <tr>
            <td colspan="6" rowspan="1"><strong>ИТОГО:</strong></td>
            <td> </td>
            <td> </td>
            <td> </td>
        </tr>
        <tr>
            <td colspan="7" rowspan="1">Размер ÑредÑтв, возмещенных за Ñчет выручки от Ð¾ÐºÐ°Ð·Ð°Ð½Ð¸Ñ ÑƒÑлуг по регулируемым ценам (тарифам) Ñ ÑƒÑ‡ÐµÑ‚Ð¾Ð¼ уÑтановленных надбавок к ценам (тарифам) в целÑÑ… финанÑÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¸Ð½Ð²ÐµÑтиционной программы </td>
            <td> </td>
            <td> </td>
        </tr>
    </tbody>
</table>

 

Posted by admin  · 13-12-2019 - 14:10

Hello,

MS Word can handle a limited number of cells with automatic widths, and your HTML exceeds it. Please set widths for all td tags to get the correct output in all DOCX readers. On https://www.phpdocx.com/documentation/cookbook/convert-html-to-word you can read more information about this (Defining widths in tables section).

Regards.

Posted by Simon87  · 13-12-2019 - 14:48

Ok, so we need to make more compact tables, thank you.

Posted by admin  · 13-12-2019 - 15:32

Hello,

If you set widths for the cells the output will be correct; you can set the widths only to the first row if needed.

Regards.

Posted by Simon87  · 13-12-2019 - 17:34

Understood, will set width explicitly.