Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
JOHNV JOHNV is offline
external usenet poster
 
Posts: 6
Default horizontally align table in ms word page

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv
  #2   Report Post  
Posted to microsoft.public.word.tables
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default horizontally align table in ms word page

Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab).

The table can be aligned center by clicking the "Center" icon in the
Alignment group.
Alternatively, the table can be centered if you set text wrapping to
"Around", click "Positioning" and select "Center" as the horizontal position.
Note the settings applied to the table.

Apply the same settings to the table that needs to be centered.

In case of Word 2007, you can open the Table Properties dialog box from the
leftmost group in the Layout tab that appears when your selection is in a
table.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv

  #3   Report Post  
Posted to microsoft.public.word.tables
JOHNV JOHNV is offline
external usenet poster
 
Posts: 6
Default horizontally align table in ms word page

Hi Lene,

Thank you for the reply. I am sorry I was not very clear in my question.
I am programmatically creating the tables, using c# and Word Interop. I have
been able to do most everything in my code, but am having a problem with this
one thing. I need to be able to programmatically adjust the table position,
from the left edge to the middle, using c# instructions. For instance, there
is a ParagraphFormat object available, but I have not been able to get the
desired results with it.

Thank you.
Johnv

"Lene Fredborg" wrote:

Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab).

The table can be aligned center by clicking the "Center" icon in the
Alignment group.
Alternatively, the table can be centered if you set text wrapping to
"Around", click "Positioning" and select "Center" as the horizontal position.
Note the settings applied to the table.

Apply the same settings to the table that needs to be centered.

In case of Word 2007, you can open the Table Properties dialog box from the
leftmost group in the Layout tab that appears when your selection is in a
table.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv

  #4   Report Post  
Posted to microsoft.public.word.tables
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default horizontally align table in ms word page

OK. I imagined you just wanted to make that final correction manually. In
VBA, you would need to manipulate the rows of the table to center the table.
For example, the following line of code will center align the first table in
the selection:

Selection.Tables(1).Rows.Alignment = wdAlignRowCenter

Maybe this can be used as a guide in your programming.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi Lene,

Thank you for the reply. I am sorry I was not very clear in my question.
I am programmatically creating the tables, using c# and Word Interop. I have
been able to do most everything in my code, but am having a problem with this
one thing. I need to be able to programmatically adjust the table position,
from the left edge to the middle, using c# instructions. For instance, there
is a ParagraphFormat object available, but I have not been able to get the
desired results with it.

Thank you.
Johnv

"Lene Fredborg" wrote:

Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab).

The table can be aligned center by clicking the "Center" icon in the
Alignment group.
Alternatively, the table can be centered if you set text wrapping to
"Around", click "Positioning" and select "Center" as the horizontal position.
Note the settings applied to the table.

Apply the same settings to the table that needs to be centered.

In case of Word 2007, you can open the Table Properties dialog box from the
leftmost group in the Layout tab that appears when your selection is in a
table.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv

  #5   Report Post  
Posted to microsoft.public.word.tables
JOHNV JOHNV is offline
external usenet poster
 
Posts: 6
Default horizontally align table in ms word page

Yes! It works great! I was trying very hard to position the entire table
as a unit, instead of individual rows. I will need to train my mind to
"think inside the box".
I noticed when Suzanne Barnhill solved a problem on this site recently, she
received a poem in payment. Since I am not a poet, please just accept my
THANK YOU!

Johnv

"Lene Fredborg" wrote:

OK. I imagined you just wanted to make that final correction manually. In
VBA, you would need to manipulate the rows of the table to center the table.
For example, the following line of code will center align the first table in
the selection:

Selection.Tables(1).Rows.Alignment = wdAlignRowCenter

Maybe this can be used as a guide in your programming.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi Lene,

Thank you for the reply. I am sorry I was not very clear in my question.
I am programmatically creating the tables, using c# and Word Interop. I have
been able to do most everything in my code, but am having a problem with this
one thing. I need to be able to programmatically adjust the table position,
from the left edge to the middle, using c# instructions. For instance, there
is a ParagraphFormat object available, but I have not been able to get the
desired results with it.

Thank you.
Johnv

"Lene Fredborg" wrote:

Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab).

The table can be aligned center by clicking the "Center" icon in the
Alignment group.
Alternatively, the table can be centered if you set text wrapping to
"Around", click "Positioning" and select "Center" as the horizontal position.
Note the settings applied to the table.

Apply the same settings to the table that needs to be centered.

In case of Word 2007, you can open the Table Properties dialog box from the
leftmost group in the Layout tab that appears when your selection is in a
table.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv



  #6   Report Post  
Posted to microsoft.public.word.tables
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default horizontally align table in ms word page

Thank you for the feedback. I am glad that I could help.

Note that it is often helpful to try recording a macro in order to find out
how Word handles an operation. The code is not always elegant but you will
very often get an idea of in which direction to go. Actually, that was what I
did in this case - I never center align tables...

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Yes! It works great! I was trying very hard to position the entire table
as a unit, instead of individual rows. I will need to train my mind to
"think inside the box".
I noticed when Suzanne Barnhill solved a problem on this site recently, she
received a poem in payment. Since I am not a poet, please just accept my
THANK YOU!

Johnv

"Lene Fredborg" wrote:

OK. I imagined you just wanted to make that final correction manually. In
VBA, you would need to manipulate the rows of the table to center the table.
For example, the following line of code will center align the first table in
the selection:

Selection.Tables(1).Rows.Alignment = wdAlignRowCenter

Maybe this can be used as a guide in your programming.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi Lene,

Thank you for the reply. I am sorry I was not very clear in my question.
I am programmatically creating the tables, using c# and Word Interop. I have
been able to do most everything in my code, but am having a problem with this
one thing. I need to be able to programmatically adjust the table position,
from the left edge to the middle, using c# instructions. For instance, there
is a ParagraphFormat object available, but I have not been able to get the
desired results with it.

Thank you.
Johnv

"Lene Fredborg" wrote:

Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab).

The table can be aligned center by clicking the "Center" icon in the
Alignment group.
Alternatively, the table can be centered if you set text wrapping to
"Around", click "Positioning" and select "Center" as the horizontal position.
Note the settings applied to the table.

Apply the same settings to the table that needs to be centered.

In case of Word 2007, you can open the Table Properties dialog box from the
leftmost group in the Layout tab that appears when your selection is in a
table.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"JOHNV" wrote:

Hi all,
I have what I think must be an easy problem. I am creating lots of tables
in an MW Word document, using C#. All of the tables appear centered on the
document page except for one. It only has one column and the table appears
aligned with the left margin. I have tried many things, but can't get it
centered horizontally on the page. Please help, as I am losing my mind. How
can I get the table centered horizontally on the page.

Thanks much.
Johnv

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have 'align left' and 'align centre' on tool bar I need align ri Blue Shadow Microsoft Word Help 1 December 17th 07 07:30 PM
How can I horizontally split a table (in WORD) into two tables? springoflife Tables 4 December 13th 07 09:52 PM
How do I divide a page into four; horizontally and vertically? 88Rainbows Microsoft Word Help 1 October 24th 07 03:28 AM
Divide page vertically and horizontally senator jazzz Microsoft Word Help 3 February 12th 06 09:28 PM
excel table in a page of a word document, horizontally AC Page Layout 1 May 17th 05 12:38 PM


All times are GMT +1. The time now is 04:19 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"