How to set table direction rtl?
it's my code:
$style = array('rtl' => true,
'name' => 'B Mitra',
'size' => 12);
$borderStyle = array('borderSize' => 6,
'borderColor' => '000000');
$table = $section->addTable($borderStyle);
$cellHCentered = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER);
$cellHEnd = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END);
$cellVCentered = array('valign' => 'center');
$i = 0;
//--------------= Questions Header
$table->addRow();
$cell = $table->addCell(500,$cellVCentered);
$textrun = $cell->addTextRun($cellHCentered);
$textrun->addText('乇丿蹖賮', $style);
$cell = $table->addCell(11000);
$textrun = $cell->addTextRun($cellHEnd);
$textrun->addText('爻賵丕賱丕鬲', $style);
$cell = $table->addCell(500,$cellVCentered);
$textrun = $cell->addTextRun($cellHCentered);
$textrun->addText('亘丕乇賲', $style);
Isn't this what you are trying to produce?

No, it's exactly reversed, in rtl table columns arranged right to left; first column in right side and last column in left. One solution is arrange columns reverse, but not correct solution;

Oh I see, it's not only the text that should be RTL, it's also the column order.
Can you provide a simple document with just that so I can see the generated XML?
I have word 2017 for mac, and I don't seem to have this "table direction" option :-(
But I tried with LibreOffice, where the option is present.
It seems what we need is http://www.datypic.com/sc/ooxml/e-w_bidiVisual-1.html
I'll try to create a pull request for this.
yes, Sure.
Questions (13).docx
this file created with office 2013, and table is rtl.
I have word 2017 for mac, and I don't seem to have this "table direction" option :-(
But I tried with LibreOffice, where the option is present.
It seems what we need is http://www.datypic.com/sc/ooxml/e-w_bidiVisual-1.html
I'll try to create a pull request for this.
Exactly, for rtl table use <w:bidiVisual/>
@mmasomi73 code has been merged to develop branch.
You can use it by defining the dependency version as "dev-develop"
Hi @troosan and @mmasomi73
how about RTL in table of content?

Most helpful comment
@mmasomi73 code has been merged to develop branch.
You can use it by defining the dependency version as "dev-develop"