Share via

How do I make a website centered?

Anonymous
2013-07-03T23:28:07+00:00

When I am working on my website on Microsoft publisher 2007, the website all appears to be centered and fine. When I go to upload my website using the publish to the web feature, or even web page preview, the entire website loads just on the left hand side of the screen. How do I make it so that it is centered no matter what computer you are viewing it from?

Website is www.gognoming.com in case you are wondering

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2013-07-04T01:11:49+00:00

    Publisher web pages are fixed width and left justified by default. If you want centered pages the only way we have found to do it over the years is to edit the code after you produce it. However you can simulate centered pages. Read the following article for a description of one way to do that.

    Reference: Understanding background padding in a Publisher web (aka whitespace):

    http://msmvps.com/blogs/dbartosik/archive/2006/01/07/80563.aspx

    As per the centering pages workaround, here is a set of directions if you choose to try it:

    When you "Publish to the Web" save the output (the index.htm file and the index_files folder if you are using the subfolder option) to a folder on your computer where you can find it. Each of your *.htm files requires adding a centering code after the existing  </head> code.

    Method 1: Manual method.

    Go to the folder on your computer where you directed your web files.

    Open each *.htm file in NotePad by right clicking the file > open with > NotePad. If you are using the subfolder option in Pub 2003 or 2007, your index.htm file is your home page, and your other *.htm files for your other pages are usually contained in a subfolder called "index_files".

    Find the </head> code, and replace with:

    </head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

    If you are using a page width that is different than 760 pixels, change the width in the code string with the width of your web pages. Close NotePad and save the changes. If you are using inches for measurement, multiply the width in inches by 96 and use that number.

    After editing the code on each *.htm file, you can upload your files to your host.

    Method 2: Semi-automatic method.

    With this method you can find the </head> code, and replace it with the revised code string in each *.htm file semi-automatically.

    Download and install the free "Replace In Files" program:

    http://www.emurasoft.com/index.htm

    Open "Replace in Files". The four boxes in the "Replace in Files" program require the following information:

    Find: </head>

    Replace with: </head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

    (Note: the code string may wrap in this message, but it is one line. Also change the width to the pixel width of your web pages. If you are using inches for measurement, multiply the width in inches by 96 and use that number.)

    File Types: *.htm

    In Folder: Use the ... button to browse to the folder where you directed your web files on your computer when you Publish to Web.

    Assuming that you are using a subfolder, check the box at the bottom "Replace in Subfolders".

    Click "Replace All", and you should get a "Finished" dialog that will confirm the replaced strings of code for each *.htm file/page in your web files.

    After editing the code you can upload your index.htm file and your index_files folder to your host.

    You will have to run Replace in Files each time you modify your Pub file and produce new web files. However, once the options in Replace in Files are filled out and the "Replace all" is selected, the entries are retained for the next time you use the program. Also once you get this process to work correctly it is an easy two click process in the future, so don't let it intimidate you.

    DavidF

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2014-11-06T22:51:52+00:00

    thanks mate for your info, its been doing my head in for days. I just wonder why pub hasn't a gui to do this, would make the prog a lot more user friendly, thanks again

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-07-04T12:31:24+00:00

    <snip>

    I tried using the method of replacing all with the code you provided, and it only did it to my home page, and not any other pages or hyperlinked albums. Is there something else I need to do?

    Be sure when you Publish to the Web and save your web files (index.htm and index_files folder) that you save them to one common folder on your local hard drive that is easy to find. Then be sure to point to that common folder. This could be called 'WebFiles' or whatever and on your desktop or perhaps in My Documents with your Publisher files. Just be consistent as to where you save those files so that you won't have to change the settings in the future.

    In the Replace in Files settings be sure to check the box at the bottom "Replace in Subfolders". This will mean that the index_files folder will be processed along with the index.htm file.

    DavidF

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-07-04T01:31:43+00:00

    Publisher web pages are fixed width and left justified by default. If you want centered pages the only way we have found to do it over the years is to edit the code after you produce it. However you can simulate centered pages. Read the following article for a description of one way to do that.

    Reference: Understanding background padding in a Publisher web (aka whitespace):

    http://msmvps.com/blogs/dbartosik/archive/2006/01/07/80563.aspx

    As per the centering pages workaround, here is a set of directions if you choose to try it:

    When you "Publish to the Web" save the output (the index.htm file and the index_files folder if you are using the subfolder option) to a folder on your computer where you can find it. Each of your *.htm files requires adding a centering code after the existing  </head> code.

    Method 1: Manual method.

    Go to the folder on your computer where you directed your web files.

    Open each *.htm file in NotePad by right clicking the file > open with > NotePad. If you are using the subfolder option in Pub 2003 or 2007, your index.htm file is your home page, and your other *.htm files for your other pages are usually contained in a subfolder called "index_files".

    Find the </head> code, and replace with:

    </head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

    If you are using a page width that is different than 760 pixels, change the width in the code string with the width of your web pages. Close NotePad and save the changes. If you are using inches for measurement, multiply the width in inches by 96 and use that number.

    After editing the code on each *.htm file, you can upload your files to your host.

    Method 2: Semi-automatic method.

    With this method you can find the </head> code, and replace it with the revised code string in each *.htm file semi-automatically.

    Download and install the free "Replace In Files" program:

    http://www.emurasoft.com/index.htm

    Open "Replace in Files". The four boxes in the "Replace in Files" program require the following information:

    Find: </head>

    Replace with: </head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

    (Note: the code string may wrap in this message, but it is one line. Also change the width to the pixel width of your web pages. If you are using inches for measurement, multiply the width in inches by 96 and use that number.)

    File Types: *.htm

    In Folder: Use the ... button to browse to the folder where you directed your web files on your computer when you Publish to Web.

    Assuming that you are using a subfolder, check the box at the bottom "Replace in Subfolders".

    Click "Replace All", and you should get a "Finished" dialog that will confirm the replaced strings of code for each *.htm file/page in your web files.

    After editing the code you can upload your index.htm file and your index_files folder to your host.

    You will have to run Replace in Files each time you modify your Pub file and produce new web files. However, once the options in Replace in Files are filled out and the "Replace all" is selected, the entries are retained for the next time you use the program. Also once you get this process to work correctly it is an easy two click process in the future, so don't let it intimidate you.

    DavidF

    I tried using the method of replacing all with the code you provided, and it only did it to my home page, and not any other pages or hyperlinked albums. Is there something else I need to do?

    Was this answer helpful?

    0 comments No comments