Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Center a table in a word document using interop.word in C#

Tags:

c#

I've been using interop.word in C# and I want to center a table in a document, all the rows are centered but I need the whole table to be centered in my document. I just can't find the property to center the whole table in a document. I've already centered all the rows but I need the table to appear centered in my document.

like image 271
David Lopez Avatar asked Apr 08 '11 18:04

David Lopez


People also ask

How do you center a table in Word in Word?

Select the text that you want to center, and then click Paragraph on the Format menu. On the Indents and Spacing tab, change the setting in the Alignment box to Centered, and then click OK.

How do you center a table in C#?

Format. Alignment=ParagraphAlignment. Center; and replace it with table.

How do I center a table in Word 2010?

Hover over the table, then click the square with arrows at the top left of the table. Click the Home tab at the top of the window. Click the Center option in the Paragraph section of the ribbon.


1 Answers

did you try table.Rows.Alignment = Word.WdRowAlignment.wdAlignRowCenter ?

like image 110
Priyank Avatar answered Oct 03 '22 15:10

Priyank