Forum


Replies: 2   Views: 945
Html list item marker highlight
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  · 21-04-2022 - 20:12

Hello,

markers apply a text hightlight color when background-color is set and only allow specific colors (black, blue, cyan, green, magenta, red, yellow, white, darkBlue, darkCyan, darkGreen, darkMagenta, darkRed, darkYellow, darkGray, lightGray). Shadings are applied to whole paragraphs and allow HEX colors.

Although you could apply hightlight colors in list and paragraph contents, the best approach for your case is using the transparent value applied to the background-color style in ul and ol tags:

$html = '<table>
  <tbody>
    <tr>
      <td style="background-color: #a9d29a;">
        <ul style="background-color: transparent;">
          <li>ef awefawef awefwef</li>
          <li>ef awefasdfsdfsdfwef awefwef</li>
          <li>sxdfsxdfxsdfef awefawef awefwe</li>
        </ul>
        <ol style="background-color: transparent;">
          <li>xdtgerg egrser</li>
          <li>seyhy7 h7yh</li>
        </ol>
      </td>
    </tr>
  </tbody>
</table>';
$docx->embedHTML($html);

Regards.