HTMLAPI documentation

HTMLAPI documentation

List of available HTML to DOCX tags.

Please refer to the pages HTML to Word and HTML Extended to learn more about this functionality.

Available attributes and styles are explained on the detail page of every tag.

When a tag is not parsed, it does not mean that its content disappears from the Word document. It only implies that their associated HTML properties are not taken directly into account. Their children and text content will be parsed and rendered with their corresponding styles into the Word document.

HTML standard
  • <a>

    Inserts a link

  • <br>

    Inserts a break

  • <div>

    Wrap contents and apply styles

  • <hr>

    Inserts a horizontal rule

  • <mark>

    Inserts a highlighted text

  • <pre>

    Inserts a preformatted text

  • <s>

    Inserts a line through text

  • <small>

    Inserts a small font size text

  • <span>

    Inserts a text in order to apply specific styles

  • <sub>

    Inserts a subscript text

  • <sup>

    Inserts a superscript text

HTML Extended (Premium licenses)

Allows to invoke phpdocx methods with HTML tags.

The following tags can be customized to use any other tag name. For example header instead of phpdocx_header or bookmark instead of phpdocx_bookmark.

  • <math>

    Inserts a MathML content

  • <meta>

    Inserts a DOCX property

  • <svg>

    Inserts an SVG content

  • <title>

    Inserts the title as a DOCX property