@@ -218,11 +218,11 @@ Table style can be defined with ``addTableStyle``:
218218.. code-block :: php
219219
220220 $tableStyle = array(
221- 'borderColor' => '006699',
222- 'borderSize' => 6 ,
223- 'cellMargin' => 50
221+ 'borderColor' => new Hex( '006699') ,
222+ 'borderSize' => Absolute::from('twip', 6) ,
223+ 'cellMargin' => Absolute::from('twip', 50)
224224 );
225- $firstRowStyle = array('bgColor' => '66BBFF');
225+ $firstRowStyle = array('bgColor' => new Hex( '66BBFF') );
226226 $phpWord->addTableStyle('myTable', $tableStyle, $firstRowStyle);
227227 $table = $section->addTable('myTable');
228228
@@ -235,7 +235,7 @@ You can span a cell on multiple columns by using ``gridSpan`` or multiple rows b
235235
236236.. code-block :: php
237237
238- $cell = $table->addCell(200);
238+ $cell = $table->addCell(Absolute::from('twip', 200) );
239239 $cell->getStyle()->setGridSpan(5);
240240
241241 See ``Sample_09_Tables.php `` for more code sample.
@@ -260,10 +260,10 @@ Examples:
260260 $section->addImage(
261261 'mars.jpg',
262262 array(
263- 'width' => 100,
264- 'height' => 100,
265- 'marginTop' => -1 ,
266- 'marginLeft' => -1 ,
263+ 'width' => Absolute::from('twip', 100) ,
264+ 'height' => Absolute::from('twip', 100) ,
265+ 'marginTop' => Absolute::from('twip', -1) ,
266+ 'marginLeft' => Absolute::from('twip', -1) ,
267267 'wrappingStyle' => 'behind'
268268 )
269269 );
@@ -285,7 +285,7 @@ header reference. After creating a header, you can use the
285285
286286 $section = $phpWord->addSection();
287287 $header = $section->addHeader();
288- $header->addWatermark('resources/_earth.jpg', array('marginTop' => 200, 'marginLeft' => 55 ));
288+ $header->addWatermark('resources/_earth.jpg', array('marginTop' => Absolute::from('twip', 200) , 'marginLeft' => Absolute::from('twip', 55) ));
289289
290290 Objects
291291-------
@@ -316,7 +316,7 @@ Options for ``$tocStyle``:
316316
317317- ``tabLeader ``. Fill type between the title text and the page number. Use the defined constants in ``\PhpOffice\PhpWord\Style\TOC ``.
318318- ``tabPos ``. The position of the tab where the page number appears in *twip *.
319- - ``indent ``. The indent factor of the titles in * twip * .
319+ - ``indent ``. The indent factor of the titles (`` \PhpOffice\PhpWord\Style\Lengths\Absolute ``) .
320320
321321Footnotes & endnotes
322322--------------------
@@ -437,13 +437,13 @@ Line elements can be added to sections by using ``addLine``.
437437
438438 Available line style attributes:
439439
440- - ``weight ``. Line width in * twip * .
441- - ``color ``. Defines the color of stroke.
440+ - ``weight ``. Line width (`` \PhpOffice\PhpWord\Style\Lengths\Absolute ``) .
441+ - ``color ``. Defines the color of stroke (`` \PhpOffice\PhpWord\Style\Colors\BasicColor ``) .
442442- ``dash ``. Line types: dash, rounddot, squaredot, dashdot, longdash, longdashdot, longdashdotdot.
443443- ``beginArrow ``. Start type of arrow: block, open, classic, diamond, oval.
444444- ``endArrow ``. End type of arrow: block, open, classic, diamond, oval.
445- - ``width ``. Line-object width in * pt * .
446- - ``height ``. Line-object height in * pt * .
445+ - ``width ``. Line-object width (`` \PhpOffice\PhpWord\Style\Lengths\Absolute ``) .
446+ - ``height ``. Line-object height (`` \PhpOffice\PhpWord\Style\Lengths\Absolute ``) .
447447- ``flip ``. Flip the line element: true, false.
448448
449449Chart
0 commit comments