Free Support Forum - aspose.com

Table Direction

Dear Sir

I could create a table with "builder.starttable" in my document.I want to set Table Direction Right to Left like MS Word in table properties but I don't know how could I do it?

Please help me.

Thanks

Mehdi Mokhtari

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I think that you should use RowFormat.Bidi property. For example see the following code example.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

//Set right to left

builder.RowFormat.Bidi = true;

builder.Font.Bidi = true;

builder.Font.LocaleIdBi = 1025;

//generate table

for (int i = 0; i < 5; i++)

{

for (int j = 0; j < 5; j++)

{

builder.InsertCell();

builder.Write("مرحبًا");

}

builder.EndRow();

}

builder.EndTable();

doc.Save(@"Test227\out.doc");

See the following link for more information.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.tables.rowformat.bidi.html

Hope this helps.

Best regards.