目前我正在努力解决
中的phpword文本框中的对齐问题我无法执行左,右和中心对齐。
$textbox =
$section->addTextBox(
array(
'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER,
'width' => 460,
'height' => 100,
'borderSize' => 1,
'borderColor' => '000',
)
);
$textbox->addText("Form No. SH-1", array('align'=>'center'));
$textbox->addText('SHARE CERTIFICATE.', $fontStyle2);
$cell = $textbox->addTable()->addRow()->addCell();
$cell->addText('Pursuant to sub-section 3 of section 46 of the Companies Act, 2013 and rule 5-2 of the Companies Share Capital and Debenture Rules, 2014', $fontStyle2);
如果有人知道,请将我放在中心的上述文字
答案 0 :(得分:0)
addText函数的第二个参数是字体样式,第三个参数是对齐规则所属的段落样式。所以你只需要正确地传递对齐规则作为第三个参数:
$textbox->addText("Form No. SH-1", null, array('align'=>'center'));
答案 1 :(得分:0)
$phpWord->addParagraphStyle('Paragraph', array('bold' => true , 'align' => 'center' ));
$textbox->addText('Hello World' , null, 'Paragraph' );