Hello,
HTML methods allow applying word styles to tables, paragraphs and characters. Each custom style can be applied to the correct contents; for example a custom paragraph style can be applied to paragraphs or headings but can't be applied to images.
On https://www.phpdocx.com/documentation/introduction/html-to-word-PHP (Using native Word formatting with HTML section) is available this same information. In the package you can also find the following sample that illustrates how to use the wordStyles option with paragraphs, tables and characters.
Borders can be added to images using HTML/CSS (https://www.phpdocx.com/htmlapi-documentation/html-standard/insert-image-Word-document-with-HTML). If you are getting a thinner border in top and bottom positions, maybe some content is overlapping it. Please check the following topic that details a very similar question: https://www.phpdocx.com/en/forum/default/topic/2199 ; we recommend adding some spacing/margin to the image or the contents to avoid that overlapping.
Regards.