|
14 | 14 | $textrun = $section->addTextRun(array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END)); |
15 | 15 | $textrun->addText('سلام این یک پاراگراف راست به چپ است', array('rtl' => true)); |
16 | 16 |
|
| 17 | +$section->addText('Table visually presented as RTL'); |
| 18 | +$style = array('rtl' => true, 'size' => 12); |
| 19 | +$tableStyle = array('borderSize' => 6, 'borderColor' => '000000', 'width' => 5000, 'unit' => \PhpOffice\PhpWord\SimpleType\TblWidth::PERCENT, 'bidiVisual' => true); |
| 20 | + |
| 21 | +$table = $section->addTable($tableStyle); |
| 22 | +$cellHCentered = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER); |
| 23 | +$cellHEnd = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END); |
| 24 | +$cellVCentered = array('valign' => \PhpOffice\PhpWord\Style\Cell::VALIGN_CENTER); |
| 25 | + |
| 26 | +//Vidually bidirectinal table |
| 27 | +$table->addRow(); |
| 28 | +$cell = $table->addCell(500, $cellVCentered); |
| 29 | +$textrun = $cell->addTextRun($cellHCentered); |
| 30 | +$textrun->addText('ردیف', $style); |
| 31 | + |
| 32 | +$cell = $table->addCell(11000); |
| 33 | +$textrun = $cell->addTextRun($cellHEnd); |
| 34 | +$textrun->addText('سوالات', $style); |
| 35 | + |
| 36 | +$cell = $table->addCell(500, $cellVCentered); |
| 37 | +$textrun = $cell->addTextRun($cellHCentered); |
| 38 | +$textrun->addText('بارم', $style); |
| 39 | + |
17 | 40 | // Save file |
18 | 41 | echo write($phpWord, basename(__FILE__, '.php'), $writers); |
19 | 42 | if (!CLI) { |
|
0 commit comments