Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrange elements #388

Closed
joshiniralim opened this issue Oct 2, 2014 · 5 comments
Closed

arrange elements #388

joshiniralim opened this issue Oct 2, 2014 · 5 comments
Assignees
Milestone

Comments

@joshiniralim
Copy link

I want to add image and text side by side like below image,
example
Here is my code :

// Create a new PHPWord Object
$PHPWord = new PHPWord();

// Every element you want to append to the word document is placed in a section. So you need a section:
$section = $PHPWord->createSection();

// Add table
$table = $section->addTable();
$table->addRow();

         $cell = $table->addCell(1000);
         $textrun = $cell->createTextRun();
         $textrun->addImage('images/example.png',array('width'=>230,'height'=>170,'marginTop' =>-1, 'marginLeft'=>-1));

         $cell1 =$table->addCell(10000);
         $textrun1 = $cell1->createTextRun();
         $textrun1->addText('Text1');

         $cell2 =$table->addCell(10000,array('cellMarginTop'=>80));
         $textrun2 = $cell2->createTextRun();
         $textrun2->addText('Text2',array('cellMarginTop'=>1400,'size' => 28,'name' => 'Highlight LET',bold => 'true', 'marginRight'=>100));

But what i am getting is :

example

How to do this ?Please help

@Progi1984
Copy link
Member

@joshiniralim Have you succeeded to make this ?

@joshiniralim
Copy link
Author

yes !

@Progi1984
Copy link
Member

@joshiniralim Could you explain how you have done ?

@joshiniralim
Copy link
Author

I have upgraded with latest version,and i am then able to use nested table concept.
Thats it

@Progi1984
Copy link
Member

@joshiniralim Thanks for your answer.

@Progi1984 Progi1984 added this to the 0.12.0 milestone Oct 7, 2014
@Progi1984 Progi1984 self-assigned this Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants