This project is read-only.

table does not work in header

Jul 26, 2012 at 11:52 AM

I need to use table in header, but it does not work. this is my code:


$header = $section->createHeader();
$table = $header->addTable($styleTable);
$table->addCell(1500)->addImage($logo_small, array('align' => 'left'));
$table->addCell(1500)->addPreserveText(' {PAGE} of {NUMPAGES} ', array('align'=>'both'));
$table->addCell(1000)->addImage($header_img, array('align' => 'right'));



has anyone tried this and had similar problems?

i am using Libre office.

Jul 27, 2012 at 6:10 AM

maybe the problem is the path to your images?

Your code sounds good: I have the nearly same code! And it works for me...

Is there any error?

Jul 27, 2012 at 9:17 AM

I tried a table without images too, just text but with no good results.

I am guessing that Libre office does not interpret some specific lines of xml of phpword. because when i create a new docx file using libre office and open it again, table disapears from header.

So i think this topic needs to be closed, because problem is not with the script.

Jul 30, 2012 at 6:49 AM

yes, I think so because I use the same code and it works as expected.

Sorry for you...

Jul 31, 2012 at 12:59 PM

It works for me ,maybe the src of your image is not correct.


what is your word version?

Jul 31, 2012 at 1:04 PM

i use Libre Office 3.5 (not MS word), so that is the problem. The script is doing its job just fine. Although in the future i hope either libre office or this script will add some more support for each other :)