Table inside textbox sample
This commit is contained in:
parent
feff87e769
commit
9ea767ea91
|
|
@ -11,7 +11,7 @@ This release changed PHPWord license from LGPL 2.1 to LGPL 3.
|
|||
- Image: Ability to define relative and absolute positioning - @basjan GH-217
|
||||
- Footer: Conform footer with header by adding firstPage, evenPage and by inheritance - @basjan @ivanlanin GH-219
|
||||
- TextBox: Ability to add textbox in section, header, and footer - @basjan @ivanlanin GH-228
|
||||
- TextBox: Ability to add textbox in table - @basjan GH-231
|
||||
- TextBox: Ability to add table inside textbox - @basjan GH-231
|
||||
- HTML: Ability to add elements to PHPWord object via html - @basjan GH-231
|
||||
|
||||
### Bugfixes
|
||||
|
|
|
|||
|
|
@ -8,15 +8,17 @@ $phpWord = new \PhpOffice\PhpWord\PhpWord();
|
|||
$section = $phpWord->addSection();
|
||||
|
||||
// In section
|
||||
$textbox = $section->addTextBox(array('align' => 'left', 'width' => 400, 'borderSize' => 1, 'borderColor' => '#FF0000'));
|
||||
$textbox = $section->addTextBox(array('align' => 'left', 'width' => 400, 'height' => 150, 'borderSize' => 1, 'borderColor' => '#FF0000'));
|
||||
$textbox->addText('Text box content in section.');
|
||||
$textbox->addText('Another line.');
|
||||
$cell = $textbox->addTable()->addRow()->addCell();
|
||||
$cell->addText('Table inside textbox');
|
||||
|
||||
// Inside table
|
||||
$section->addTextBreak(2);
|
||||
$cell = $section->addTable()->addRow()->addCell(300);
|
||||
$textbox = $cell->addTextBox(array('borderSize' => 1, 'borderColor' => '#0000FF', 'innerMargin' => 100));
|
||||
$textbox->addText('Inside table');
|
||||
$textbox->addText('Textbox inside table');
|
||||
|
||||
// Inside header with textrun
|
||||
$header = $section->addHeader();
|
||||
|
|
|
|||
Loading…
Reference in New Issue