Skip to content

Commit 9ea767e

Browse files
committed
Table inside textbox sample
1 parent feff87e commit 9ea767e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This release changed PHPWord license from LGPL 2.1 to LGPL 3.
1111
- Image: Ability to define relative and absolute positioning - @basjan GH-217
1212
- Footer: Conform footer with header by adding firstPage, evenPage and by inheritance - @basjan @ivanlanin GH-219
1313
- TextBox: Ability to add textbox in section, header, and footer - @basjan @ivanlanin GH-228
14-
- TextBox: Ability to add textbox in table - @basjan GH-231
14+
- TextBox: Ability to add table inside textbox - @basjan GH-231
1515
- HTML: Ability to add elements to PHPWord object via html - @basjan GH-231
1616

1717
### Bugfixes

samples/Sample_25_TextBox.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
$section = $phpWord->addSection();
99

1010
// In section
11-
$textbox = $section->addTextBox(array('align' => 'left', 'width' => 400, 'borderSize' => 1, 'borderColor' => '#FF0000'));
11+
$textbox = $section->addTextBox(array('align' => 'left', 'width' => 400, 'height' => 150, 'borderSize' => 1, 'borderColor' => '#FF0000'));
1212
$textbox->addText('Text box content in section.');
1313
$textbox->addText('Another line.');
14+
$cell = $textbox->addTable()->addRow()->addCell();
15+
$cell->addText('Table inside textbox');
1416

1517
// Inside table
1618
$section->addTextBreak(2);
1719
$cell = $section->addTable()->addRow()->addCell(300);
1820
$textbox = $cell->addTextBox(array('borderSize' => 1, 'borderColor' => '#0000FF', 'innerMargin' => 100));
19-
$textbox->addText('Inside table');
21+
$textbox->addText('Textbox inside table');
2022

2123
// Inside header with textrun
2224
$header = $section->addHeader();

0 commit comments

Comments
 (0)