Forum


Replies: 8   Views: 4641
Auto highlight the text when background color is set
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 anzai408  · 21-02-2014 - 08:16

Hi, I encounter a issue here When I using the replaceTemplateVariableByHTML. I am trying to adopt the html table to the doc. What I encountered is when I try to put background-color to the row, it will auto hilight the row text which I do not want.



Here is my code. 



$table = '<table style="border-collapse: collapse;">

                      <tr style="background-color:#9bbb59; color:red; font-weight: bold;">

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">No</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Test</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Dest</span>

                          </td>

                      </tr>

                      <tr>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Just Try</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Just Try</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Just Try</span>

                          </td>

                      </tr>

                  </table>';



$docx->replaceTemplateVariableByHTML('TABLE_1', 'block', $table, array('isFile' => false, 'parseDivsAsPs' => false, 'downloadImages' => true));