title: PhpWord: How to create a new paragraph with border and background color?
body: <p>I am trying to create a neat Word document using the <a href="http://phpword.readthedocs.org/en/latest/index.html" rel="nofollow">PhpWord library</a>. Unfortunately, the documentation seems to be incomplete. I'd like to have paragraphs with a border and a background color, spanning the whole page width. I did some research and found the attributes borderSize and borderColor which are undocumented for the addText method. There also is a bgColor attribute which can be set on text. The following example creates a paragraph surrounded with a border. The text has some background color too, but it's just the text, not the whole area surrounded by the border. The attribute bgColor unfortunately does not have any effect on paragraph level.</p>
  
  <p>Does anyone have an idea on how to achieve this?</p>
  
  <pre><code>use \PhpOffice\PhpWord\IOFactory;
  $document = new \PhpOffice\PhpWord\PhpWord();
  $titlepage = $document-&gt;createSection();
  $titlepage-&gt;addText('My Title', 
      array("size" =&gt; 24, "color" =&gt; "FF0000", "bgColor"=&gt;"00FF00"),
      array("borderSize"=&gt;6, "borderColor"=&gt;"0000FF")
  );
  $objWriter = IOFactory::createWriter($document, 'Word2007');
  </code></pre>