Search code examples
phpphpword

PHPWord horizontal line (<hr />)


I am currently using PHPWord to generate my documents, but I want to add an horizontal line in the document. Just like an


in HMTL. In word you can do this by typing three underscores en enter, but I want to use it in my generated document.

Does anybody have more information about this feature?

Thank you!


Solution

  • Can you try using to add table and applying border instead of to add <hr> using phpword

         $styleTable = array('borderSize'=>1, 'borderColor'=>'006699');
         $styleFirstRow = array('borderBottomSize'=>1, 'borderBottomColor'=>'0000FF');
         $this->word->addTableStyle('myOwnTableStyle', $styleTable, $styleFirstRow);
         // Add table
         $table = $section->addTable('myOwnTableStyle');
    

    Ref: http://www.ahowto.net/php/creating-ms-word-document-using-codeigniter-and-phpword