From 9ea767ea91bb32c6ec31f2891af8db5772705d37 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Sat, 10 May 2014 22:04:10 +0700 Subject: [PATCH] Table inside textbox sample --- CHANGELOG.md | 2 +- samples/Sample_25_TextBox.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 403a32bd..a337da69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/samples/Sample_25_TextBox.php b/samples/Sample_25_TextBox.php index 1946315f..4beb9553 100644 --- a/samples/Sample_25_TextBox.php +++ b/samples/Sample_25_TextBox.php @@ -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();