Forum


Replies: 5   Views: 2189
Table with empty cell and space after table
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 admin  · 26-02-2020 - 17:01

Hello,

Thanks for sending the requested information.

About your questions:

1. When one of table cell is empty, row with this cell is with corrupted style. Extra space appears and the cursor appears at the top of the cell.

Text styles aren't applied to cells but contents. So if you want to apply a content style, you need to add a blank space at least:

<tr>
    <td>2 Quisque ac augue eu nibh</td>
    <td>&nbsp;</td>
</tr>

Otherwise, no style is added and the default styles are used when writing content.

2. After table i need to add text with style. Before text should be one line. If text without any tag, then <br> works perfect, but when text is with tage appears extra space.

A <br> tag generates a w:br tag inside the w:p tag (paragraph tag). The extra space you see is from the paragraph generated when adding the content, that doesn't have the same size than a break tag. We recommend you to wrap the contents in a paragraph and apply the needed styles (margin, padding...) to get the output you want:

<p>
<div style="font-weight: bold;">First new line</div><br>
2 new line<br>
3 new line<br>
4 new line<br><br>
5 Second new line'
</p>

Regards.