How to Set Cell Alignment and Text Direction in .net

hi
How to Set table Cell Alignment and Text Direction in .net?

builder.MoveToMergeField(mergeFieldName);
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;

thanks!

Hi Kin,
Thanks for your request. Horizontal alignment of text inside table cells is specified as alignment of paragraphs inside this cell. So, you need to change horizontal alignment, just change alignment of paragraphs inside cell.
Best regards,

hi
How do I set the Text Direction, please give me the specific code!
thanks!

Hi Kin,
Thanks for your request. you can find a simple code example here:
https://reference.aspose.com/words/net/aspose.words/font/bidi/
Best regards,

hi

sorry, my English is not good, I did not express clearly!pls check a.doc!

thanks!

Hello,
Thank you for your inquiry.
Alexey has already given you a link to the code. I copy the code from our documentation.

DocumentBuilder builder = new DocumentBuilder();
// Signal to Microsoft Word that this run of text contains right-to-left text.
builder.Font.Bidi = true;
// Specify the font and font size to be used for the right-to-left text.
builder.Font.NameBi = "Andalus";
builder.Font.SizeBi = 48;
// Specify that the right-to-left text in this run is bold and italic.
builder.Font.ItalicBi = true;
builder.Font.BoldBi = true;
// Specify the locale so Microsoft Word recognizes this text as Arabic - Saudi Arabia.
// For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx
builder.Font.LocaleIdBi = 1025;
// Insert some Arabic text.
builder.Writeln("مرحبًا");
builder.Document.Save(MyDir + "Font.Bidi Out.doc");

Hope this helps.

hi
Do you have check a.doc it? I’ve tried the code, can not achieve what I want
thanks!

Hi Kin,
Sorry for inconvenience. You should use CellFormat.Orientation property to achieve what you need.
https://reference.aspose.com/words/net/aspose.words.tables/cellformat/orientation/
Best regards,

dear alexey
Thank you for your help!!!