create
[ class tree: create ] [ index: create ] [ all elements ]

example

  1. <?php
  2.  
  3. /**
  4.  * Creates a WordML fragment composed of twice the same table that is inserted within another table
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage easy
  9.  * @copyright  Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
  10.  *              (http://www.2mdc.com)
  11.  * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  12.  * @version    2012.12.26
  13.  * @link       http://www.phpdocx.com
  14.  * @since      2012.12.26
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $valuesTable array(
  21.     array(
  22.         11,
  23.         12
  24.     ),
  25.     array(
  26.         21,
  27.         22
  28.     ),
  29. );
  30.  
  31. $paramsTable array(
  32.     'border' => 'single',
  33.     'border_sz' => 4,
  34.     'rawWordML' => true
  35. );
  36.  
  37. $myTable $docx->addTable($valuesTable$paramsTable);
  38.  
  39. $fragment $docx->createWordMLFragment(array($myTable$myTable));
  40.  
  41. $valuesTable2 array(
  42.     array(
  43.         a,
  44.         b
  45.     ),
  46.     array(
  47.         $fragment,
  48.         c
  49.     ),
  50. );
  51.  
  52. $paramsTable2 array(
  53.     'border' => 'single',
  54.     'border_sz' => 20,
  55. );
  56.  
  57. $docx->addTable($valuesTable2$paramsTable2);
  58.  
  59. $docx->createDocx('../docx/example_wordMLFragment');

Documentation generated on Mon, 13 Jan 2014 13:44:11 +0100 by phpDocumentor 1.4.4