Centering Web Pages in Publisher 2007

J

John G

Has MS finally resolved the issue of left aligned web pages now that
Publisher 2007 is available for download? If not, is there a way of
modifying a new site I've built in Publisher 2007 (without starting all over
again)?

I've read the blog about the workaround used for Publisher 2003, but am
really shocked that there isn't a checkbox in Publisher 2007 that will center
Web Pages. This was never an issue in Front Page, and 'centering' is a
simple check box on most other publishing programs, particularly those that
can be used to create and publish web sites.

Thanks,
John G
 
D

DavidF

Hi John G,

Sorry to say that they still have not incorporated this feature in Pub
2007...wish they had.

You can center the pages, but it requires manually changing the coding with
Pub 2003 and 2007. This means that if your pages are static...that you don't
update them very often, you might find it worth the effort. In fact if you
have just a few pages that are being updated periodically, you might
separate them out and produce them with other Publisher files, and build
your site with multiple files and subfolders. Then if you want to center any
particular page...

Do this:

1. Publish your website so that you have an HTML copy on your hard drive.

2. Open "index.html" in a HTML editor, or at the worst, Notepad

3. Scroll down until you see the <body> tag

4. Underneath the <body> tag, enter (copy and paste will work) this code:

<table border="0" cellpadding="0" cellspacing="2" width="768"
align="center">
<tr>
<td>

(you may need to play with the width dimension)

5. Scroll all the way to the bottom until you see the </body> tag.

6. ABOVE the </body> tag, enter the following:

</td>
</tr>
</table>

Your content on that page should now be centered. Repeat with other pages
that you want centered.

DavidF
 
D

DavidF

I agree John...I would really like to see this feature added to 2007, or at
least a good workaround provided. In the meantime, I am afraid you will need
to research this yourself. I know a bit about coding, but a very little
bit...even the code I gave you was provided by someone else. It worked for
me, but...

Try going to http://www.lissaexplains.com/ and typing in "centering", and
there are a bunch of posts in her forum about the subject. Here is just one:
http://lissaexplains.com/forum/showthread.php?p=411945

Another good resource:
http://www.htmlgoodies.com/

If you figure out a good workaround, please post it. When I get sometime I
will see what I can come up with, but that won't be soon...got lots of stuff
I need to be doing.

DavidF
 
D

DavidF

I couldn't resist trying this again. Try opening the file with NotePad
instead of WordPad. You can even open the file with IE, and then go to View
Source and in my case it automatically opens in NotePad.

Then try copy and pasting the first snippet right below the second </head>
tag, and the second snippet right above the last <body> tag. This worked for
me with a Pub 2003 file just now. If it works for you, then the directions I
gave you are wrong. Let me know.

DavidF
 
M

MIchaeldane

This is a freeware program that works for PUb 2000, not sure about any other
versions.

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

In the find window put </body>
In the replace window put <body background ="back.jpg"
bgproperties="fixed">
In the folder windwo point to the folder that containers your files, index
etc.
Don't change anything else

Try it and see if this centers your page
This program updates all your pages at the same time so you don't have to
edit every single page.
 
D

DavidF

Thanks, but no joy. I think that using this program might be a good tool for
this, but this particular string of code did not work in Pub 2003. Perhaps
someone that understands coding will experiment with Publisher 2003 html
files and come up with code that will work.

One problem will still remain for those who use HTTP uploading protocol,
which is required if you use a form on your site. Those html files are not
saved to your computer before uploading to the web server, and thus could
not be modified. To use this tool, the user would have to Publish to the Web
to their computer, modify the html files, and then use FTP uploading
protocol to upload the html files to the web server. This "breaks" the FPSE
which are required for the form to work.

The best solution would be if MS added the feature as an option in Publisher
before generating the html files. The next best is find some code snippet
that can be inserted into the Publisher page before generating the html
files, and thereby the centering code would be present every time the user
modified the page in Publisher and republishing new html code to their web
server. Editing the code by hand, or even with this tool every time you want
to make a change in a webpage is just not very practical unless your pages
are fairly static...or even workable if you are using a form on the site.

If you want to use Publisher to produce a website, there are always going to
be some limitations, and for now having pages that are left justified is one
of them. Unless someone can come up with a code snippet that can be inserted
via the insert code fragment tool, I think in most case one should learn to
live with the left justified pages. You can make some design changes in your
page to at least "simulate" a centered page if that is important to you.
Read David Bartosik's article: Understanding background padding in a
Publisher web (aka white space):
http://msmvps.com/blogs/dbartosik/archive/2006/01/07/80563.aspx

DavidF
 
C

cb94

I used the code you suggested and my page centered without issue (text,
images, etc.). When I go to other pages on my website, they are all left
justified. I'm new to programming, what am I doing wrong?
 
C

cb94

OK. How do I identify the spots for each of my pages? I've looked for the
names I assigned each page and found the .htm but don't see anywhere, similar
to your instructions, that the code should be placed. Inside the index.htm
file, I only have the one </head> and </body>. Thanks.
 
C

cb94

Please ignore the last post. Had I fully read index_files rather than
assuming index.htm I wouldn't have asked. Sorry. Thanks for the help.
Works great!
 
D

DavidF

You have to apply the code to each page. The other pages of your site are
contained in the index_files folder. And each time you modify your Pub doc,
you will have to do it again.

DavidF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top