Hi,
I am trying to add table in document using wordfragement but not getting displayed.
Code:
$text = [];
$table = new WordFragment( $docx );
$valuesTable = array(
array(
'Charge Name', 'Due Date', 'Amount'
),
array(
'Electricity', '9/28/2017' , $100.65
)
);
$paramsTable = array(
'border' => 'single',
'tableAlign' => 'center',
'borderWidth' => 5,
);
$table->addTable( $valuesTable, $paramsTable );
$html = new WordFragment( $docx);
$html->embedHtml('<p>Hi I am here <p>');
$text[] = $table;
$text[] = $html
$docx->addText($text);
$docx->createDocx('test.docx');
Please correct me where I am wrong.
Thanks,
Shilpa